Skip to content

Commit

Permalink
chore: remove reduntant return
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior committed Aug 10, 2023
1 parent 75799ff commit 688c78c
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dot/sync/worker_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,11 @@ func (s *syncWorkerPool) ignorePeerAsWorker(who peer.ID) {
defer s.mtx.Unlock()

worker, has := s.workers[who]
if !has {
return
if has {
close(worker.queue)
delete(s.workers, who)
s.ignorePeers[who] = struct{}{}
}

close(worker.queue)
delete(s.workers, who)
s.ignorePeers[who] = struct{}{}
return
}

// totalWorkers only returns available or busy workers
Expand Down

0 comments on commit 688c78c

Please sign in to comment.