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

Method SetIndex

libs/bits/bit_array.go:67–74  ·  view source on GitHub ↗

SetIndex sets the bit at index i within the bit array. The behavior is undefined if i >= bA.Bits

(i int, v bool)

Source from the content-addressed store, hash-verified

65// SetIndex sets the bit at index i within the bit array.
66// The behavior is undefined if i >= bA.Bits
67func (bA *BitArray) SetIndex(i int, v bool) bool {
68 if bA == nil {
69 return false
70 }
71 bA.mtx.Lock()
72 defer bA.mtx.Unlock()
73 return bA.setIndex(i, v)
74}
75
76func (bA *BitArray) setIndex(i int, v bool) bool {
77 if i >= bA.Bits {

Callers 10

NewPartSetFromDataFunction · 0.95
randBitArrayFunction · 0.95
TestBytesFunction · 0.95
TestEmptyFullFunction · 0.95
TestJSONMarshalUnmarshalFunction · 0.95
UnmarshalJSONMethod · 0.95
addVerifiedVoteMethod · 0.45
addVerifiedVoteMethod · 0.45
AddPartMethod · 0.45
BitArrayMethod · 0.45

Calls 3

setIndexMethod · 0.95
LockMethod · 0.65
UnlockMethod · 0.65

Tested by 4

randBitArrayFunction · 0.76
TestBytesFunction · 0.76
TestEmptyFullFunction · 0.76
TestJSONMarshalUnmarshalFunction · 0.76