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

Function setBitmapRange

util.go:162–177  ·  view source on GitHub ↗
(bitmap []uint64, start int, end int)

Source from the content-addressed store, hash-verified

160}
161
162func setBitmapRange(bitmap []uint64, start int, end int) {
163 if start >= end {
164 return
165 }
166 firstword := start / 64
167 endword := (end - 1) / 64
168 if firstword == endword {
169 bitmap[firstword] |= (^uint64(0) << uint(start%64)) & (^uint64(0) >> (uint(-end) % 64))
170 return
171 }
172 bitmap[firstword] |= ^uint64(0) << uint(start%64)
173 for i := firstword + 1; i < endword; i++ {
174 bitmap[i] = ^uint64(0)
175 }
176 bitmap[endword] |= ^uint64(0) >> (uint(-end) % 64)
177}
178
179func flipBitmapRangeAndCardinalityChange(bitmap []uint64, start int, end int) int {
180 before := wordCardinalityForBitmapRange(bitmap, start, end)

Callers 3

resetToMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…