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

Method iorArray

runcontainer.go:2288–2302  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

2286//}
2287
2288func (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
2304func runArrayUnionToRuns(rc *runContainer16, ac *arrayContainer) ([]interval16, uint16) {
2305 pos1 := 0

Callers 1

iorMethod · 0.95

Calls 5

isEmptyMethod · 0.95
runArrayUnionToRunsFunction · 0.85
cloneMethod · 0.65
isEmptyMethod · 0.65

Tested by

no test coverage detected