mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2026-01-28 11:54:51 -05:00
perf: small optim in Pool.sequence_a
This commit is contained in:
parent
dd1cf2a046
commit
8982f87ca7
1 changed files with 1 additions and 0 deletions
|
|
@ -517,6 +517,7 @@ module Make(P : PARAM) = struct
|
||||||
(* map an array of futures to a future array *)
|
(* map an array of futures to a future array *)
|
||||||
let sequence_a a = match a with
|
let sequence_a a = match a with
|
||||||
| [||] -> return [||]
|
| [||] -> return [||]
|
||||||
|
| [| x |] -> map (fun x->[|x|]) x
|
||||||
| _ ->
|
| _ ->
|
||||||
sequence_ (A_ a)
|
sequence_ (A_ a)
|
||||||
(fun () -> Array.map get_nolock_ a)
|
(fun () -> Array.map get_nolock_ a)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue