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

Method nextValue

bitmapcontainer.go:1378–1384  ·  view source on GitHub ↗

nextValue returns either the `target` if found or the next largest value. if the target is out of bounds a -1 is returned Example : Suppose the bitmap container represents the following slice [1,2,10,11,100] target=0 returns 1 target=1 returns 1 target=10 returns 10 target=90 returns 100

(target uint16)

Source from the content-addressed store, hash-verified

1376// target=10 returns 10
1377// target=90 returns 100
1378func (bc *bitmapContainer) nextValue(target uint16) int {
1379 if bc.cardinality == 0 {
1380 return -1
1381 }
1382
1383 return bc.NextSetBit(uint(target))
1384}
1385
1386// nextAbsentValue returns the next absent value.
1387// if the target is out of bounds a -1 is returned

Callers

nothing calls this directly

Calls 1

NextSetBitMethod · 0.95

Tested by

no test coverage detected