MCPcopy
hub / github.com/RoaringBitmap/roaring / lazyIOR

Method lazyIOR

bitmapcontainer.go:509–544  ·  view source on GitHub ↗
(a container)

Source from the content-addressed store, hash-verified

507}
508
509func (bc *bitmapContainer) lazyIOR(a container) container {
510 switch x := a.(type) {
511 case *arrayContainer:
512 return bc.lazyIORArray(x)
513 case *bitmapContainer:
514 return bc.lazyIORBitmap(x)
515 case *runContainer16:
516 if x.isFull() {
517 return x.clone()
518 }
519
520 // Manually inlined setBitmapRange function
521 bitmap := bc.bitmap
522 for _, iv := range x.iv {
523 start := int(iv.start)
524 end := int(iv.last()) + 1
525 if start >= end {
526 continue
527 }
528 firstword := start / 64
529 endword := (end - 1) / 64
530 if firstword == endword {
531 bitmap[firstword] |= (^uint64(0) << uint(start%64)) & (^uint64(0) >> (uint(-end) % 64))
532 continue
533 }
534 bitmap[firstword] |= ^uint64(0) << uint(start%64)
535 for i := firstword + 1; i < endword; i++ {
536 bitmap[i] = ^uint64(0)
537 }
538 bitmap[endword] |= ^uint64(0) >> (uint(-end) % 64)
539 }
540 bc.cardinality = invalidCardinality
541 return bc
542 }
543 panic("unsupported container type")
544}
545
546func (bc *bitmapContainer) lazyOR(a container) container {
547 switch x := a.(type) {

Callers

nothing calls this directly

Calls 5

lazyIORArrayMethod · 0.95
lazyIORBitmapMethod · 0.95
lastMethod · 0.80
isFullMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected