ClearBit clears the bit at the given position.
(k uint64)
| 167 | |
| 168 | // ClearBit clears the bit at the given position. |
| 169 | func (sba *sparseBitArray) ClearBit(k uint64) error { |
| 170 | index, position := getIndexAndRemainder(k) |
| 171 | i := sba.indices.get(index) |
| 172 | if i == -1 { |
| 173 | return nil |
| 174 | } |
| 175 | |
| 176 | sba.blocks[i] = sba.blocks[i].remove(position) |
| 177 | if sba.blocks[i] == 0 { |
| 178 | sba.blocks.deleteAtIndex(i) |
| 179 | sba.indices.deleteAtIndex(i) |
| 180 | } |
| 181 | |
| 182 | return nil |
| 183 | } |
| 184 | |
| 185 | // Reset erases all values from this bitarray. |
| 186 | func (sba *sparseBitArray) Reset() { |
nothing calls this directly
no test coverage detected