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

Method nextAbsentValue

runcontainer.go:2881–2889  ·  view source on GitHub ↗

nextAbsentValue returns the next absent value. By construction the next absent value will be located between gaps in runs Ex: if our runs resemble [[a,b],[c,d]] and a <= target <= b then b+1 will not be equal to c, b+1 will be returned Ex: if target < a then target is returned Ex: if target > d th

(target uint16)

Source from the content-addressed store, hash-verified

2879// Ex: if target < a then target is returned
2880// Ex: if target > d then target is returned
2881func (rc *runContainer16) nextAbsentValue(target uint16) int {
2882 whichIndex, alreadyPresent, _ := rc.search(int(target))
2883
2884 if !alreadyPresent {
2885 return int(target)
2886 }
2887
2888 return int(rc.iv[whichIndex].last()) + 1
2889}
2890
2891// previousValue will return the previous present value
2892// If the target is in the interior of a run then `target` will be returned

Callers

nothing calls this directly

Calls 2

searchMethod · 0.95
lastMethod · 0.80

Tested by

no test coverage detected