Skip to content

Commit

Permalink
Simplify inFlight.get method logic
Browse files Browse the repository at this point in the history
  • Loading branch information
bitwiseguy committed Apr 16, 2024
1 parent c2e27fd commit 32f9860
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions op-node/p2p/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,8 @@ func (s *inFlight) set(key uint64, value bool) {

func (s *inFlight) get(key uint64) bool {
s.mu.Lock()
value, exists := s.requests[key]
s.mu.Unlock()
if !exists {
return false
} else {
return value
}
defer s.mu.Unlock()
return s.requests[key]
}

func (s *inFlight) delete(key uint64) {
Expand Down

0 comments on commit 32f9860

Please sign in to comment.