From f243744adb3d6045d386e02611bdc74ba65aa1a4 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sun, 31 Aug 2025 14:14:49 +0100 Subject: [PATCH] refactor(boot): replace concat + filter_map with concat_map Signed-off-by: Rudi Grinberg --- boot/duneboot.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/boot/duneboot.ml b/boot/duneboot.ml index f9cef6f3ac8..96b94c27488 100644 --- a/boot/duneboot.ml +++ b/boot/duneboot.ml @@ -1285,24 +1285,24 @@ let convert_dependencies ~all_source_files { Dep.file; deps = dependencies } = let filename = String.uncapitalize_ascii module_name in if filename = Filename.chop_extension file then (* Self-reference *) - None + [] else if String.Set.mem (filename ^ ".mli") all_source_files then if (not is_mli) && String.Set.mem (filename ^ ".ml") all_source_files then (* We need to build the .ml for inlining info *) - Some [ filename ^ ".mli"; filename ^ ".ml" ] + [ filename ^ ".mli"; filename ^ ".ml" ] else (* .mli files never depend on .ml files *) - Some [ filename ^ ".mli" ] + [ filename ^ ".mli" ] else if String.Set.mem (filename ^ ".ml") all_source_files then (* If there's no .mli, then we must always depend on the .ml *) - Some [ filename ^ ".ml" ] + [ filename ^ ".ml" ] else (* This is a module coming from an external library *) - None + [] in let dependencies = - let dependencies = List.concat (List.filter_map ~f:convert_module dependencies) in + let dependencies = List.concat_map ~f:convert_module dependencies in (* .ml depends on .mli, if it exists *) if (not is_mli) && String.Set.mem (file ^ "i") all_source_files then (file ^ "i") :: dependencies