Such code should not be used as it will not preserve the container invariants: func (rc *runContainer16) iorBitmapContainer(bc *bitmapContainer) container { it := bc.getShortIterator() for it.hasNext() { rc.Add(it.next()) } return rc }
(ac *arrayContainer)
| 2286 | //} |
| 2287 | |
| 2288 | func (rc *runContainer16) iorArray(ac *arrayContainer) container { |
| 2289 | if rc.isEmpty() { |
| 2290 | return ac.clone() |
| 2291 | } |
| 2292 | if ac.isEmpty() { |
| 2293 | return rc |
| 2294 | } |
| 2295 | var cardMinusOne uint16 |
| 2296 | // TODO: perform the union algorithm in-place using rc.iv |
| 2297 | // this can be done with methods like the in-place array container union |
| 2298 | // but maybe lazily moving the remaining elements back. |
| 2299 | rc.iv, cardMinusOne = runArrayUnionToRuns(rc, ac) |
| 2300 | return rc.toEfficientContainerFromCardinality(int(cardMinusOne) + 1) |
| 2301 | |
| 2302 | } |
| 2303 | |
| 2304 | func runArrayUnionToRuns(rc *runContainer16, ac *arrayContainer) ([]interval16, uint16) { |
| 2305 | pos1 := 0 |
no test coverage detected