mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
force Vector's initial size to be >= 3
This commit is contained in:
parent
3b6722d1c4
commit
7360834241
1 changed files with 2 additions and 2 deletions
|
|
@ -32,9 +32,9 @@ type 'a t = {
|
||||||
}
|
}
|
||||||
|
|
||||||
let create i =
|
let create i =
|
||||||
assert (i >= 0);
|
let i = max i 3 in
|
||||||
{ size = 0;
|
{ size = 0;
|
||||||
vec = if i = 0 then [||] else Array.create i (Obj.magic None);
|
vec = Array.create i (Obj.magic None);
|
||||||
}
|
}
|
||||||
|
|
||||||
(** resize the underlying array so that it can contains the
|
(** resize the underlying array so that it can contains the
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue