(i int, needsWriteable bool)
| 319 | } |
| 320 | |
| 321 | func (ra *roaringArray) getFastContainerAtIndex(i int, needsWriteable bool) container { |
| 322 | c := ra.getContainerAtIndex(i) |
| 323 | switch t := c.(type) { |
| 324 | case *arrayContainer: |
| 325 | c = t.toBitmapContainer() |
| 326 | case *runContainer16: |
| 327 | if !t.isFull() { |
| 328 | c = t.toBitmapContainer() |
| 329 | } |
| 330 | case *bitmapContainer: |
| 331 | if needsWriteable && ra.needCopyOnWrite[i] { |
| 332 | c = ra.containers[i].clone() |
| 333 | } |
| 334 | } |
| 335 | return c |
| 336 | } |
| 337 | |
| 338 | // getUnionedWritableContainer switches behavior for in-place Or |
| 339 | // depending on whether the container requires a copy on write. |
no test coverage detected