File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -51,4 +51,4 @@ let untar_precomputed_blocks t output =
5151 let precomputed_blocks_zip = precomputed_blocks_zip t in
5252 let % bind _ = Utils. untar ~archive: precomputed_blocks_zip ~output in
5353 let % bind array = Sys. readdir output in
54- Deferred. return (Array. to_list array |> Utils. dedup_and_sort_archive_files )
54+ Deferred. return (Array. to_list array |> Utils. sort_archive_files )
Original file line number Diff line number Diff line change @@ -11,15 +11,21 @@ let sed ~search ~replacement ~input =
1111let untar ~archive ~output =
1212 Util. run_cmd_exn " ." " tar" [ " -xf" ; archive; " -C" ; output ]
1313
14+ let precomputed_blocks_comparator left right =
15+ let scan_height name = Scanf. sscanf name " %_s@-%d-%_s" Fn. id in
16+ let left_height = scan_height left in
17+ let right_height = scan_height right in
18+ Int. compare left_height right_height
19+
20+ let sort_archive_files files : string list =
21+ files
22+ |> List. sort ~compare: (fun left right ->
23+ precomputed_blocks_comparator left right )
24+
1425let dedup_and_sort_archive_files files : string list =
1526 files
1627 |> List. dedup_and_sort ~compare: (fun left right ->
17- let scan_height name = Scanf. sscanf name " %_s@-%d-%_s" Fn. id in
18-
19- let left_height = scan_height left in
20- let right_height = scan_height right in
21-
22- Int. compare left_height right_height )
28+ precomputed_blocks_comparator left right )
2329
2430let force_kill process =
2531 Process. send_signal process Core.Signal. kill ;
You can’t perform that action at this time.
0 commit comments