Skip to content

Commit

Permalink
core/state: avoid unnecessary alloc in trie prefetcher (ethereum#23198)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Jul 12, 2021
1 parent 58b0420 commit 8fe47b0
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/state/trie_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,12 +312,11 @@ func (sf *subfetcher) loop() {

default:
// No termination request yet, prefetch the next entry
taskid := string(task)
if _, ok := sf.seen[taskid]; ok {
if _, ok := sf.seen[string(task)]; ok {
sf.dups++
} else {
sf.trie.TryGet(task)
sf.seen[taskid] = struct{}{}
sf.seen[string(task)] = struct{}{}
}
}
}
Expand Down

0 comments on commit 8fe47b0

Please sign in to comment.