diff options
author | robot-contrib <[email protected]> | 2025-06-15 09:25:25 +0300 |
---|---|---|
committer | robot-contrib <[email protected]> | 2025-06-15 09:48:27 +0300 |
commit | 726087f32fb38c191ff0c3ef8c6646aa940d987e (patch) | |
tree | a3495141325c08ddea3a6050274d221ddbce6664 /contrib/libs/croaring/src | |
parent | b73dea5dc2b4ce1e07a5445c2cea548039cb1b3d (diff) |
Update contrib/libs/croaring to 4.3.3
commit_hash:39a69dfa71c7a4f33f49fcb243fc529ea807c652
Diffstat (limited to 'contrib/libs/croaring/src')
-rw-r--r-- | contrib/libs/croaring/src/containers/run.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/libs/croaring/src/containers/run.c b/contrib/libs/croaring/src/containers/run.c index 986db6d1ac8..1f2c74f8128 100644 --- a/contrib/libs/croaring/src/containers/run.c +++ b/contrib/libs/croaring/src/containers/run.c @@ -135,20 +135,22 @@ void run_container_offset(const run_container_t *c, container_t **loc, run_container_t *lo = NULL, *hi = NULL; bool split; - int lo_cap, hi_cap; + unsigned int lo_cap, hi_cap; int top, pivot; top = (1 << 16) - offset; pivot = run_container_index_equalorlarger(c, top); + // pivot is the index of the first run that is >= top or -1 if no such run - if (pivot == -1) { - split = false; - lo_cap = c->n_runs; - hi_cap = 0; - } else { + if(pivot >= 0) { split = c->runs[pivot].value < top; lo_cap = pivot + (split ? 1 : 0); hi_cap = c->n_runs - pivot; + } else { + // here pivot < 0 + split = false; + lo_cap = c->n_runs; + hi_cap = 0; } if (loc && lo_cap) { |