MCPcopy
hub / github.com/RoaringBitmap/roaring / Remove

Method Remove

roaring.go:1210–1220  ·  view source on GitHub ↗

Remove the integer x from the bitmap

(x uint32)

Source from the content-addressed store, hash-verified

1208
1209// Remove the integer x from the bitmap
1210func (rb *Bitmap) Remove(x uint32) {
1211 hb := highbits(x)
1212 i := rb.highlowcontainer.getIndex(hb)
1213 if i >= 0 {
1214 c := rb.highlowcontainer.getWritableContainerAtIndex(i).iremoveReturnMinimized(lowbits(x))
1215 rb.highlowcontainer.setContainerAtIndex(i, c)
1216 if rb.highlowcontainer.getContainerAtIndex(i).isEmpty() {
1217 rb.highlowcontainer.removeAtIndex(i)
1218 }
1219 }
1220}
1221
1222// CheckedRemove removes the integer x from the bitmap and return true if the integer was effectively removed (and false if the integer was not present)
1223func (rb *Bitmap) CheckedRemove(x uint32) bool {

Callers 8

TestCloneOfCOWFunction · 0.95
TestIntersects1COWFunction · 0.95
TestBitmapCOWFunction · 0.95
TestIntersects1Function · 0.95
TestBitmapFunction · 0.95
smatRemoveBitFunction · 0.45
SetValueMethod · 0.45

Calls 9

highbitsFunction · 0.70
lowbitsFunction · 0.70
isEmptyMethod · 0.65
getIndexMethod · 0.45
setContainerAtIndexMethod · 0.45
getContainerAtIndexMethod · 0.45
removeAtIndexMethod · 0.45

Tested by 6

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