Skip to content

Commit

Permalink
Simplifies if
Browse files Browse the repository at this point in the history
  • Loading branch information
diegoximenes committed Nov 1, 2024
1 parent 7ca0f24 commit d71865a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions validator/server_arb/machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,8 @@ func (m *ArbitratorMachine) Destroy() {

if m.contextId != nil {
resolverWithRefCounter, ok := preimageResolvers.Load(*m.contextId)
if ok {
if resolverWithRefCounter.refCounter.Add(-1) == 0 {
preimageResolvers.Delete(*m.contextId)
}
if ok && (resolverWithRefCounter.refCounter.Add(-1) == 0) {
preimageResolvers.Delete(*m.contextId)
}
}
m.contextId = nil
Expand Down

0 comments on commit d71865a

Please sign in to comment.