mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
more reasonable increase in size in CCVector
This commit is contained in:
parent
4579213e63
commit
174957e604
1 changed files with 2 additions and 1 deletions
|
|
@ -98,7 +98,8 @@ let _grow v x =
|
|||
if _empty_array v
|
||||
then v.vec <- Array.make 32 x
|
||||
else
|
||||
let size = min (2 * Array.length v.vec + 10) Sys.max_array_length in
|
||||
let n = Array.length v.vec in
|
||||
let size = min (n + n/2 + 10) Sys.max_array_length in
|
||||
_resize v size
|
||||
|
||||
let ensure v size =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue