From ba1876f95791a0616b05719154665fdda3fc4f9e Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 21 Mar 2024 17:01:42 -0400 Subject: [PATCH] remove use of 5.1 only function --- test/lwt/hash_client.ml | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/test/lwt/hash_client.ml b/test/lwt/hash_client.ml index e6ea0c6d..085666fb 100644 --- a/test/lwt/hash_client.ml +++ b/test/lwt/hash_client.ml @@ -31,18 +31,6 @@ let main ~port ~runner ~ext ~dir ~n_conn () : unit Lwt.t = () else if Str_tbl.mem seen file then () - else if Sys.is_regular_file file then - if ext <> "" && Filename.extension file <> ext then - () - else ( - Str_tbl.add seen file (); - M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.write_line oc file); - let res = - M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.read_line ic) - in - let@ () = M.Lock.with_ lock_stdout in - Printf.printf "%s\n%!" res - ) else if Sys.is_directory file then ( let _sp = Trace.enter_manual_sub_span ~parent:_sp ~__FILE__ ~__LINE__ "walk-dir" @@ -53,6 +41,14 @@ let main ~port ~runner ~ext ~dir ~n_conn () : unit Lwt.t = let d = Sys.readdir file in Array.sort String.compare d; Array.iter (fun sub -> walk (Filename.concat file sub)) d + ) else if ext <> "" && Filename.extension file <> ext then + () + else ( + Str_tbl.add seen file (); + M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.write_line oc file); + let res = M_lwt.run_in_lwt_and_await (fun () -> Lwt_io.read_line ic) in + let@ () = M.Lock.with_ lock_stdout in + Printf.printf "%s\n%!" res ) in walk dir;