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

Method remove

roaringarray.go:387–394  ·  view source on GitHub ↗
(key uint16)

Source from the content-addressed store, hash-verified

385}
386
387func (ra *roaringArray) remove(key uint16) bool {
388 i := ra.binarySearch(0, int64(len(ra.keys)), key)
389 if i >= 0 { // if a new key
390 ra.removeAtIndex(i)
391 return true
392 }
393 return false
394}
395
396func (ra *roaringArray) removeAtIndex(i int) {
397 copy(ra.keys[i:], ra.keys[i+1:])

Callers 4

TestRoaringArrayCOWFunction · 0.45
TestRoaringArrayFunction · 0.45
TestArrayContainerEtc070Function · 0.45

Calls 2

binarySearchMethod · 0.95
removeAtIndexMethod · 0.95

Tested by 4

TestRoaringArrayCOWFunction · 0.36
TestRoaringArrayFunction · 0.36
TestArrayContainerEtc070Function · 0.36