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