mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
Assert for growing vectors
This commit is contained in:
parent
a2e2e15137
commit
e748333693
1 changed files with 1 additions and 1 deletions
|
|
@ -58,6 +58,7 @@ let grow_to_double_size t =
|
|||
grow_to t size
|
||||
|
||||
let grow_to_by_double t new_capa =
|
||||
assert (new_capa >= 0);
|
||||
if new_capa > Sys.max_array_length then _size_too_big ();
|
||||
let data = t.data in
|
||||
let capa = ref (Array.length data + 1) in
|
||||
|
|
@ -66,7 +67,6 @@ let grow_to_by_double t new_capa =
|
|||
done;
|
||||
grow_to t !capa
|
||||
|
||||
|
||||
let is_full t = Array.length t.data = t.sz
|
||||
|
||||
let push t e =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue