GetIndex returns the bit at index i within the bit array. The behavior is undefined if i >= bA.Bits
(i int)
| 42 | // GetIndex returns the bit at index i within the bit array. |
| 43 | // The behavior is undefined if i >= bA.Bits |
| 44 | func (bA *BitArray) GetIndex(i int) bool { |
| 45 | if bA == nil { |
| 46 | return false |
| 47 | } |
| 48 | bA.mtx.Lock() |
| 49 | defer bA.mtx.Unlock() |
| 50 | return bA.getIndex(i) |
| 51 | } |
| 52 | |
| 53 | func (bA *BitArray) getIndex(i int) bool { |
| 54 | if i >= bA.Bits { |