From b201e88e63a1c25c76df1d5d11723a1ed904819b Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 21 Oct 2024 13:26:30 +0200 Subject: [PATCH] CR --- compiler/lib/source_map.ml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/compiler/lib/source_map.ml b/compiler/lib/source_map.ml index f04fb14964..4c1e1bcb1c 100644 --- a/compiler/lib/source_map.ml +++ b/compiler/lib/source_map.ml @@ -394,15 +394,16 @@ module Standard = struct ; names = List.rev_append sm.names acc_rev.names ; sources_content = (match acc_rev.sources_content with - | Some acc_rev -> ( - match sm.sources_content with - | Some x -> Some (List.rev_append x acc_rev) - | None _ -> - Some - (List.rev_append - (List.map sm.sources ~f:(fun _ -> None)) - acc_rev) - | None -> None)) + | Some acc_rev -> + let contents = + match sm.sources_content with + | Some x -> + assert (List.length x = List.length sm.sources); + x + | None -> List.map sm.sources ~f:(fun _ -> None) + in + Some (List.rev_append contents acc_rev) + | None -> None) ; mappings = Mappings.empty } , List.rev_append_map