MCPcopy Create free account
hub / github.com/tendermint/tendermint / IsEmpty

Method IsEmpty

libs/bits/bit_array.go:211–223  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

209
210// IsEmpty returns true iff all bits in the bit array are 0
211func (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.
226func (bA *BitArray) IsFull() bool {

Callers 1

TestEmptyFullFunction · 0.95

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by 1

TestEmptyFullFunction · 0.76