Skip to content

Commit

Permalink
common/lru: use clear builtin (ethereum#29399)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiweixie authored Apr 2, 2024
1 parent ab6419c commit 12dcc16
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions common/lru/basiclru.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ func (c *BasicLRU[K, V]) Peek(key K) (value V, ok bool) {
// Purge empties the cache.
func (c *BasicLRU[K, V]) Purge() {
c.list.init()
for k := range c.items {
delete(c.items, k)
}
clear(c.items)
}

// Remove drops an item from the cache. Returns true if the key was present in cache.
Expand Down

0 comments on commit 12dcc16

Please sign in to comment.