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 jorgemmsilva committed Jun 17, 2024
1 parent da44781 commit e398fd6
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 e398fd6

Please sign in to comment.