MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / IsEmpty

Method IsEmpty

libs/bits/bit_array.go:206–218  ·  view source on GitHub ↗

IsEmpty returns true iff all bits in the bit array are 0

()

Source from the content-addressed store, hash-verified

204
205// IsEmpty returns true iff all bits in the bit array are 0
206func (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.
221func (bA *BitArray) IsFull() bool {

Callers 1

TestEmptyFullFunction · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by 1

TestEmptyFullFunction · 0.76