mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-03 11:45:18 +00:00
libs/bits: inline defer and change order of mutexes (#5187)
* libs/bits: inline defer and change order of mutexes Closes #3217 * abci/client: unexpose StopForError func a) it's not called outside b) the reason for exposing it in the first place is unclear c) Stop already exist if someone from outside wants to stop the client
This commit is contained in:
@@ -355,14 +355,12 @@ func (bA *BitArray) Update(o *BitArray) {
|
||||
if bA == nil || o == nil {
|
||||
return
|
||||
}
|
||||
|
||||
bA.mtx.Lock()
|
||||
o.mtx.Lock()
|
||||
defer func() {
|
||||
bA.mtx.Unlock()
|
||||
o.mtx.Unlock()
|
||||
}()
|
||||
|
||||
copy(bA.Elems, o.Elems)
|
||||
o.mtx.Unlock()
|
||||
bA.mtx.Unlock()
|
||||
}
|
||||
|
||||
// MarshalJSON implements json.Marshaler interface by marshaling bit array
|
||||
|
||||
Reference in New Issue
Block a user