MCPcopy Create free account
hub / github.com/RoaringBitmap/roaring / Remove

Method Remove

roaring64/roaring64.go:355–365  ·  view source on GitHub ↗

Remove the integer x from the bitmap

(x uint64)

Source from the content-addressed store, hash-verified

353
354// Remove the integer x from the bitmap
355func (rb *Bitmap) Remove(x uint64) {
356 hb := highbits(x)
357 i := rb.highlowcontainer.getIndex(hb)
358 if i >= 0 {
359 c := rb.highlowcontainer.getWritableContainerAtIndex(i)
360 c.Remove(lowbits(x))
361 if c.IsEmpty() {
362 rb.highlowcontainer.removeAtIndex(i)
363 }
364 }
365}
366
367// CheckedRemove removes the integer x from the bitmap and return true if the integer was effectively remove (and false if the integer was not present)
368func (rb *Bitmap) CheckedRemove(x uint64) bool {

Callers 7

TestCloneOfCOWFunction · 0.95
TestCloneOfCOWRangeFunction · 0.95
TestIntersects1COWFunction · 0.95
TestBitmapCOWFunction · 0.95
TestIntersects1Function · 0.95
TestBitmapFunction · 0.95
SetBigValueMethod · 0.45

Calls 6

highbitsFunction · 0.70
lowbitsFunction · 0.70
getIndexMethod · 0.45
IsEmptyMethod · 0.45
removeAtIndexMethod · 0.45

Tested by 6

TestCloneOfCOWFunction · 0.76
TestCloneOfCOWRangeFunction · 0.76
TestIntersects1COWFunction · 0.76
TestBitmapCOWFunction · 0.76
TestIntersects1Function · 0.76
TestBitmapFunction · 0.76