From af40f2e19494e84d4917f8a1c3e2efb1c216f2df Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Thu, 31 Oct 2024 15:31:48 +0800 Subject: [PATCH] eth/downloader: fix staticcheck warning S1033: unnecessary guard for delete --- eth/downloader/statesync.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/eth/downloader/statesync.go b/eth/downloader/statesync.go index 0012c0c67f..d27092e02f 100644 --- a/eth/downloader/statesync.go +++ b/eth/downloader/statesync.go @@ -419,9 +419,7 @@ func (s *stateSync) process(req *stateReq) error { default: return fmt.Errorf("invalid state node %s: %v", hash.TerminalString(), err) } - if _, ok := req.tasks[hash]; ok { - delete(req.tasks, hash) - } + delete(req.tasks, hash) } // Put unfulfilled tasks back into the retry queue npeers := s.d.peers.Len()