From d60bf3828b068615873af8b5d5d6be91ccfe7b9d Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 15 Jun 2023 11:42:13 -0400 Subject: [PATCH] fix: join_array on arrays of length=1 had a bound error --- src/fut.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fut.ml b/src/fut.ml index 4e3ddbd8..2260eb30 100644 --- a/src/fut.ml +++ b/src/fut.ml @@ -285,7 +285,7 @@ let join_container_ ~iter ~map ~len cont : _ t = let join_array (a : _ t array) : _ array t = match Array.length a with | 0 -> return [||] - | 1 -> map ?on:None a.(1) ~f:(fun x -> [| x |]) + | 1 -> map ?on:None a.(0) ~f:(fun x -> [| x |]) | _ -> join_container_ ~len:Array.length ~map:Array.map ~iter:Array.iter a let join_list (l : _ t list) : _ list t =