From 8982f87ca7fdf0d8f29bdd2a93101ba2278eea9b Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Wed, 24 Mar 2021 18:44:28 -0400 Subject: [PATCH] perf: small optim in Pool.sequence_a --- src/threads/CCPool.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/threads/CCPool.ml b/src/threads/CCPool.ml index 2a6b5e95..59dffa92 100644 --- a/src/threads/CCPool.ml +++ b/src/threads/CCPool.ml @@ -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)