Skip to content

Commit fd520e1

Browse files
authored
perf: speed up roaring_bitmap_remove (#699)
container_nonzero_cardinality has to do less work for bitset/run containers than calculating the full cardinality.
1 parent acf85af commit fd520e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/roaring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ void roaring_bitmap_remove(roaring_bitmap_t *r, uint32_t val) {
614614
ra_set_container_at_index(&r->high_low_container, i, container2,
615615
newtypecode);
616616
}
617-
if (container_get_cardinality(container2, newtypecode) != 0) {
617+
if (container_nonzero_cardinality(container2, newtypecode)) {
618618
ra_set_container_at_index(&r->high_low_container, i, container2,
619619
newtypecode);
620620
} else {

0 commit comments

Comments
 (0)