(a container)
| 1113 | } |
| 1114 | |
| 1115 | func (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 | |
| 1141 | func (bc *bitmapContainer) toArrayContainer() *arrayContainer { |
| 1142 | ac := &arrayContainer{} |
nothing calls this directly
no test coverage detected