Skip to content

Commit

Permalink
Use roaring64_bitmap_clear
Browse files Browse the repository at this point in the history
  • Loading branch information
jhawthorn committed Jun 24, 2024
1 parent 1464640 commit a275ee4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ext/roaring/bitmap64.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static VALUE rb_roaring64_replace(VALUE self, VALUE other) {
// FIXME: Very likely a newer version of CRoaring will have
//roaring64_bitmap_overwrite(self_data, other_data);

roaring64_bitmap_remove_range_closed(self_data, 0, UINT64_MAX);
roaring64_bitmap_clear(self_data);
roaring64_bitmap_or_inplace(self_data, other_data);

return self;
Expand Down Expand Up @@ -120,8 +120,7 @@ static VALUE rb_roaring64_empty_p(VALUE self)
static VALUE rb_roaring64_clear(VALUE self)
{
roaring64_bitmap_t *data = get_bitmap(self);
// roaring64_bitmap_clear(data); // Doesn't exist yet in 4.0.0
roaring64_bitmap_remove_range_closed(data, 0, UINT64_MAX);
roaring64_bitmap_clear(data);
return self;
}

Expand Down

0 comments on commit a275ee4

Please sign in to comment.