IsEmpty returns true iff all bits in the bit array are 0
()
| 204 | |
| 205 | // IsEmpty returns true iff all bits in the bit array are 0 |
| 206 | func (bA *BitArray) IsEmpty() bool { |
| 207 | if bA == nil { |
| 208 | return true // should this be opposite? |
| 209 | } |
| 210 | bA.mtx.Lock() |
| 211 | defer bA.mtx.Unlock() |
| 212 | for _, e := range bA.Elems { |
| 213 | if e > 0 { |
| 214 | return false |
| 215 | } |
| 216 | } |
| 217 | return true |
| 218 | } |
| 219 | |
| 220 | // IsFull returns true iff all bits in the bit array are 1. |
| 221 | func (bA *BitArray) IsFull() bool { |