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

Method iadd

bitmapcontainer.go:375–383  ·  view source on GitHub ↗

iadd adds the arg i, returning true if not already present

(i uint16)

Source from the content-addressed store, hash-verified

373
374// iadd adds the arg i, returning true if not already present
375func (bc *bitmapContainer) iadd(i uint16) bool {
376 x := int(i)
377 previous := bc.bitmap[x/64]
378 mask := uint64(1) << (uint(x) % 64)
379 newb := previous | mask
380 bc.bitmap[x/64] = newb
381 bc.cardinality += int((previous ^ newb) >> (uint(x) % 64))
382 return newb != previous
383}
384
385func (bc *bitmapContainer) iremoveReturnMinimized(i uint16) container {
386 if bc.iremove(i) {

Callers 1

iaddReturnMinimizedMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected