mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 20:46:40 +00:00
common/lru: use clear builtin (#29399)
This commit is contained in:
parent
ab6419ccd8
commit
12dcc162d0
1 changed files with 1 additions and 3 deletions
|
|
@ -115,9 +115,7 @@ func (c *BasicLRU[K, V]) Peek(key K) (value V, ok bool) {
|
||||||
// Purge empties the cache.
|
// Purge empties the cache.
|
||||||
func (c *BasicLRU[K, V]) Purge() {
|
func (c *BasicLRU[K, V]) Purge() {
|
||||||
c.list.init()
|
c.list.init()
|
||||||
for k := range c.items {
|
clear(c.items)
|
||||||
delete(c.items, k)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove drops an item from the cache. Returns true if the key was present in cache.
|
// Remove drops an item from the cache. Returns true if the key was present in cache.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue