From 21c10d2ad4b6eed03ef2bd90da6d092a32055943 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 3 Feb 2022 19:15:13 -0500 Subject: [PATCH] less aggressive constant. series of sizes should now be: ``` # let next n = n + n lsr 1 + 2;; # CCSeq.unfold (fun x -> Some (x, next x)) 0 |> CCSeq.take 20 |> CCSeq.to_list;; - : int list = [0; 2; 5; 9; 15; 24; 38; 59; 90; 137; 207; 312; 470; 707; 1062; 1595; 2394; 3593; 5391; 8088] ``` --- src/core/CCVector.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/CCVector.ml b/src/core/CCVector.ml index a4d96201..719ea85e 100644 --- a/src/core/CCVector.ml +++ b/src/core/CCVector.ml @@ -84,7 +84,7 @@ let[@inline] array_is_empty_ v = (* next capacity, if current one is [n] *) let[@inline] next_grow_ n = - min Sys.max_array_length (n + n lsr 1 + 5) + min Sys.max_array_length (n + n lsr 1 + 2) (* resize the underlying array using x to temporarily fill the array *) let resize_ v newcapacity x =