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

Method previousAbsentValue

runcontainer.go:2923–2931  ·  view source on GitHub ↗

previousAbsentValue will return the previous absent value If the target is in the interior of a run then then the start of the range minus 1 will be returned Example: If our run structure resmembles [[x,z], [a,c], [d,f]] with a <= target <= c then a-1 will be returned. if the target < x then targe

(target uint16)

Source from the content-addressed store, hash-verified

2921// if the target < x then target is returned
2922// if target > f then target is returned
2923func (rc *runContainer16) previousAbsentValue(target uint16) int {
2924 whichIndex, alreadyPresent, _ := rc.search(int(target))
2925
2926 if !alreadyPresent {
2927 return int(target)
2928 }
2929
2930 return int(rc.iv[whichIndex].start) - 1
2931}
2932
2933// isNonContiguousDisjoint returns an error if the intervals overlap e.g have non-empty intersection
2934func isNonContiguousDisjoint(outer interval16, inner interval16) error {

Callers

nothing calls this directly

Calls 1

searchMethod · 0.95

Tested by

no test coverage detected