mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 19:25:28 -05:00
put back more advanced resize heuristic
This commit is contained in:
parent
55b866ae63
commit
acd1b6e97e
1 changed files with 2 additions and 2 deletions
|
|
@ -71,8 +71,8 @@ let blit_from b from_buf o len =
|
||||||
if (Array.length from_buf) = 0 then () else
|
if (Array.length from_buf) = 0 then () else
|
||||||
let cap = capacity b - length b in
|
let cap = capacity b - length b in
|
||||||
(* resize if needed, with a constant to amortize *)
|
(* resize if needed, with a constant to amortize *)
|
||||||
if capacity b < b.size then
|
if cap < len then
|
||||||
resize b b.size from_buf.(0);
|
resize b (min b.size (Array.length b.buf + len + 24)) from_buf.(0);
|
||||||
let sub = Array.sub from_buf o len in
|
let sub = Array.sub from_buf o len in
|
||||||
let iter i x =
|
let iter i x =
|
||||||
b.start <- i mod capacity b;
|
b.start <- i mod capacity b;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue