Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove temporary map used for sorting #6472

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/dune_engine/diff_promotion.ml
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,13 @@ let filter_db files_to_promote db =
let display files_to_promote =
let open Fiber.O in
let files = load_db () |> filter_db files_to_promote in
let module FileMap = Map.Make (File) in
let+ diff_opts =
Fiber.parallel_map files ~f:(fun file ->
let+ diff_opt = diff_for_file file in
match diff_opt with
| Ok diff -> Some (file, diff)
| Error _ -> None)
in
diff_opts |> List.filter_opt |> FileMap.of_list_exn
|> FileMap.iter ~f:Print_diff.Diff.print
diff_opts |> List.filter_opt
|> List.sort ~compare:(fun (file, _) (file', _) -> File.compare file file')
|> List.iter ~f:(fun (_file, diff) -> Print_diff.Diff.print diff)