GetBit returns a bool indicating if the value at the given index has been set.
(k uint64)
| 109 | // GetBit returns a bool indicating if the value at the given |
| 110 | // index has been set. |
| 111 | func (ba *bitArray) GetBit(k uint64) (bool, error) { |
| 112 | if k >= ba.Capacity() { |
| 113 | return false, OutOfRangeError(k) |
| 114 | } |
| 115 | |
| 116 | i, pos := getIndexAndRemainder(k) |
| 117 | result := ba.blocks[i]&block(1<<pos) != 0 |
| 118 | return result, nil |
| 119 | } |
| 120 | |
| 121 | // GetSetBits gets the position of bits set in the array. |
| 122 | func (ba *bitArray) GetSetBits(from uint64, buffer []uint64) []uint64 { |
nothing calls this directly
no test coverage detected