remove the values in the range [firstOfRange,endx)
(firstOfRange, endx int)
| 142 | |
| 143 | // remove the values in the range [firstOfRange,endx) |
| 144 | func (ac *arrayContainer) iremoveRange(firstOfRange, endx int) container { |
| 145 | if firstOfRange >= endx { |
| 146 | return ac |
| 147 | } |
| 148 | indexstart := binarySearch(ac.content, uint16(firstOfRange)) |
| 149 | if indexstart < 0 { |
| 150 | indexstart = -indexstart - 1 |
| 151 | } |
| 152 | indexend := binarySearch(ac.content, uint16(endx-1)) |
| 153 | if indexend < 0 { |
| 154 | indexend = -indexend - 1 |
| 155 | } else { |
| 156 | indexend++ |
| 157 | } |
| 158 | rangelength := indexend - indexstart |
| 159 | answer := ac |
| 160 | copy(answer.content[indexstart:], ac.content[indexstart+rangelength:]) |
| 161 | answer.content = answer.content[:ac.getCardinality()-rangelength] |
| 162 | return answer |
| 163 | } |
| 164 | |
| 165 | // flip the values in the range [firstOfRange,endx) |
| 166 | func (ac *arrayContainer) not(firstOfRange, endx int) container { |
nothing calls this directly
no test coverage detected