force Vector's initial size to be >= 3

This commit is contained in:
Simon Cruanes 2013-03-17 18:45:53 +01:00
parent 3b6722d1c4
commit 7360834241

View file

@ -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