( opBits func(idx int, off1 uint32, off2 uint32), opWord func(idx int), i0 int, i1 int, )
| 145 | } |
| 146 | |
| 147 | func opRange( |
| 148 | opBits func(idx int, off1 uint32, off2 uint32), |
| 149 | opWord func(idx int), |
| 150 | i0 int, |
| 151 | i1 int, |
| 152 | ) { |
| 153 | idx0, off0 := ioff(i0) |
| 154 | idx1, off1 := ioff(i1) |
| 155 | if idx0 == idx1 { |
| 156 | opBits(idx0, off0, off1) |
| 157 | return |
| 158 | } |
| 159 | if off0 != 0 { |
| 160 | opBits(idx0, off0, 63) |
| 161 | idx0++ |
| 162 | } |
| 163 | if off1 != 63 { |
| 164 | opBits(idx1, 0, off1) |
| 165 | idx1-- |
| 166 | } |
| 167 | for idx := idx0; idx <= idx1; idx++ { |
| 168 | opWord(idx) |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | func (b *BitArray) setBits(idx int, off1 uint32, off2 uint32) { |
| 173 | b.vs[idx] |= upperMask(off1) & lowerMask(off2) |
no test coverage detected