mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-11 05:28:33 -05:00
fix: join_array on arrays of length=1 had a bound error
This commit is contained in:
parent
5d4a29a056
commit
793f57e537
1 changed files with 1 additions and 1 deletions
|
|
@ -259,7 +259,7 @@ let join_container_ ~iter ~map ~len cont : _ t =
|
||||||
let join_array (a : _ t array) : _ array t =
|
let join_array (a : _ t array) : _ array t =
|
||||||
match Array.length a with
|
match Array.length a with
|
||||||
| 0 -> return [||]
|
| 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
|
| _ -> join_container_ ~len:Array.length ~map:Array.map ~iter:Array.iter a
|
||||||
|
|
||||||
let join_list (l : _ t list) : _ list t =
|
let join_list (l : _ t list) : _ list t =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue