From ae7bb40357f5a7081ebed91e40ccd431d5f48486 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Fri, 15 Jul 2022 18:36:05 +0200 Subject: [PATCH] trie: fix 'gosimple' lint issue (#25309) --- trie/sync.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/trie/sync.go b/trie/sync.go index 7f4e67dbfecb..303fcbfa22e2 100644 --- a/trie/sync.go +++ b/trie/sync.go @@ -249,17 +249,16 @@ func (s *Sync) Missing(max int) ([]string, []common.Hash, []common.Hash) { s.queue.Pop() s.fetches[depth]++ - switch item.(type) { + switch item := item.(type) { case common.Hash: - codeHashes = append(codeHashes, item.(common.Hash)) + codeHashes = append(codeHashes, item) case string: - path := item.(string) - req, ok := s.nodeReqs[path] + req, ok := s.nodeReqs[item] if !ok { - log.Error("Missing node request", "path", path) + log.Error("Missing node request", "path", item) continue // System very wrong, shouldn't happen } - nodePaths = append(nodePaths, path) + nodePaths = append(nodePaths, item) nodeHashes = append(nodeHashes, req.hash) } }