SetIndex sets the bit at index i within the bit array. The behavior is undefined if i >= bA.Bits
(i int, v bool)
| 60 | // SetIndex sets the bit at index i within the bit array. |
| 61 | // The behavior is undefined if i >= bA.Bits |
| 62 | func (bA *BitArray) SetIndex(i int, v bool) bool { |
| 63 | if bA == nil { |
| 64 | return false |
| 65 | } |
| 66 | bA.mtx.Lock() |
| 67 | defer bA.mtx.Unlock() |
| 68 | return bA.setIndex(i, v) |
| 69 | } |
| 70 | |
| 71 | func (bA *BitArray) setIndex(i int, v bool) bool { |
| 72 | if i >= bA.Bits { |