add the values in the range [firstOfRange, endx). endx is still abe to express 2^16 because it is an int not an uint16.
(firstOfRange, endx int)
| 2044 | // add the values in the range [firstOfRange, endx). endx |
| 2045 | // is still abe to express 2^16 because it is an int not an uint16. |
| 2046 | func (rc *runContainer16) iaddRange(firstOfRange, endx int) container { |
| 2047 | if firstOfRange > endx { |
| 2048 | panic(fmt.Sprintf("invalid %v = endx > firstOfRange", endx)) |
| 2049 | } |
| 2050 | if firstOfRange == endx { |
| 2051 | return rc |
| 2052 | } |
| 2053 | addme := newRunContainer16TakeOwnership([]interval16{ |
| 2054 | { |
| 2055 | start: uint16(firstOfRange), |
| 2056 | length: uint16(endx - 1 - firstOfRange), |
| 2057 | }, |
| 2058 | }) |
| 2059 | *rc = *rc.union(addme) |
| 2060 | return rc |
| 2061 | } |
| 2062 | |
| 2063 | // remove the values in the range [firstOfRange,endx) |
| 2064 | func (rc *runContainer16) iremoveRange(firstOfRange, endx int) container { |