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 and gzliudan committed Aug 26, 2024
1 parent 9f0d0ee commit 696814d
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 696814d

Please sign in to comment.