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)
| 2879 | // Ex: if target < a then target is returned |
| 2880 | // Ex: if target > d then target is returned |
| 2881 | func (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 |