MCPcopy Index your code
hub / github.com/RoaringBitmap/roaring / resetTo

Method resetTo

bitmapcontainer.go:1115–1139  ·  view source on GitHub ↗
(a container)

Source from the content-addressed store, hash-verified

1113}
1114
1115func (bc *bitmapContainer) resetTo(a container) {
1116 switch x := a.(type) {
1117 case *arrayContainer:
1118 fill(bc.bitmap, 0)
1119 bc.loadData(x)
1120
1121 case *bitmapContainer:
1122 bc.cardinality = x.cardinality
1123 copy(bc.bitmap, x.bitmap)
1124
1125 case *runContainer16:
1126 bc.cardinality = len(x.iv)
1127 lastEnd := 0
1128 for _, r := range x.iv {
1129 bc.cardinality += int(r.length)
1130 resetBitmapRange(bc.bitmap, lastEnd, int(r.start))
1131 lastEnd = int(r.start+r.length) + 1
1132 setBitmapRange(bc.bitmap, int(r.start), lastEnd)
1133 }
1134 resetBitmapRange(bc.bitmap, lastEnd, maxCapacity)
1135
1136 default:
1137 panic("unsupported container type")
1138 }
1139}
1140
1141func (bc *bitmapContainer) toArrayContainer() *arrayContainer {
1142 ac := &arrayContainer{}

Callers

nothing calls this directly

Calls 4

loadDataMethod · 0.95
fillFunction · 0.85
resetBitmapRangeFunction · 0.85
setBitmapRangeFunction · 0.85

Tested by

no test coverage detected