perf: small optim in Pool.sequence_a

This commit is contained in:
Simon Cruanes 2021-03-24 18:44:28 -04:00
parent dd1cf2a046
commit 8982f87ca7

View file

@ -517,6 +517,7 @@ module Make(P : PARAM) = struct
(* map an array of futures to a future array *)
let sequence_a a = match a with
| [||] -> return [||]
| [| x |] -> map (fun x->[|x|]) x
| _ ->
sequence_ (A_ a)
(fun () -> Array.map get_nolock_ a)