Changed manual map clearing with a built-in clear method in lrucache

This commit is contained in:
Egor 2024-06-05 20:45:46 +03:00
parent 83f0d33374
commit 6e6c742228

View file

@ -58,9 +58,7 @@ func (c *lrucache) Range(f func(key, value int) bool) {
} }
func (c *lrucache) Clear() { func (c *lrucache) Clear() {
for k := range c.data { clear(c.data)
delete(c.data, k)
}
c.recentEntries.Init() c.recentEntries.Init()
} }