Skip to content

Commit

Permalink
common/lru: use clear builtin (#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

2 comments on commit 12dcc16

@jiguur123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

asvbdfg
dfg

dfg
d
g
dfg
ds !#R? GA"
lf
fm
piahinzLKhv'zsodfhvnklhvoufh'/z W"EQ{IR zdV'ZOSIHDF JLVB;UFE8AYBRVcj' FOPH'9
snF'ISHDFNcdk'SPDUF'XNC/IDHF[AWK'DFJA[ETU[AKXVJ'DZUG[OZS
SKZFS
GFJ'ZDOGJ'DPJ'DFH' K
ip rgo SDFKz pGZsgpk zG OZ
///F/DG'ID ZR'PK2K4-957

@jiguur123
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GFFGH
PFDT' /IBHSZV IHZSIEYT'K'GDNngWRHG

ZDGISHEWGipPHEGIIP

Please sign in to comment.