IsSet returns true if bit i is true
(i int)
| 11 | |
| 12 | // IsSet returns true if bit i is true |
| 13 | func (bm BitMap) IsSet(i int) bool { |
| 14 | if i < 0 { |
| 15 | return false |
| 16 | } |
| 17 | |
| 18 | word := i / bits.UintSize |
| 19 | if word >= len(bm) { |
| 20 | return false |
| 21 | } |
| 22 | |
| 23 | bit := uint(i % bits.UintSize) |
| 24 | return bm[word]&(uint(1)<<bit) != 0 |
| 25 | } |
| 26 | |
| 27 | // Set causes bit i to be true/1 |
| 28 | func (bm *BitMap) Set(i int) { |
no outgoing calls
no test coverage detected