MCPcopy Index your code
hub / github.com/RoaringBitmap/roaring / newBitmapContainerwithRange

Function newBitmapContainerwithRange

bitmapcontainer.go:30–48  ·  view source on GitHub ↗
(firstOfRun, lastOfRun int)

Source from the content-addressed store, hash-verified

28}
29
30func newBitmapContainerwithRange(firstOfRun, lastOfRun int) *bitmapContainer {
31 bc := newBitmapContainer()
32 bc.cardinality = lastOfRun - firstOfRun + 1
33 if bc.cardinality == maxCapacity {
34 fill(bc.bitmap, uint64(0xffffffffffffffff))
35 } else {
36 firstWord := firstOfRun / 64
37 lastWord := lastOfRun / 64
38 zeroPrefixLength := uint64(firstOfRun & 63)
39 zeroSuffixLength := uint64(63 - (lastOfRun & 63))
40
41 fillRange(bc.bitmap, firstWord, lastWord+1, uint64(0xffffffffffffffff))
42 bc.bitmap[firstWord] ^= ((uint64(1) << zeroPrefixLength) - 1)
43 blockOfOnes := (uint64(1) << zeroSuffixLength) - 1
44 maskOnLeft := blockOfOnes << (uint64(64) - zeroSuffixLength)
45 bc.bitmap[lastWord] ^= maskOnLeft
46 }
47 return bc
48}
49
50func (bc *bitmapContainer) minimum() uint16 {
51 for i := 0; i < len(bc.bitmap); i++ {

Calls 3

newBitmapContainerFunction · 0.85
fillFunction · 0.85
fillRangeFunction · 0.85

Used in the wild real call sites across dependent graphs

searching dependent graphs…