From 6e6c74222866d3d80b4c56f778985080af921577 Mon Sep 17 00:00:00 2001 From: erius Date: Wed, 5 Jun 2024 20:45:46 +0300 Subject: [PATCH] Changed manual map clearing with a built-in clear method in lrucache --- lrucache/lru.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lrucache/lru.go b/lrucache/lru.go index 5cd4c48..44f84c8 100644 --- a/lrucache/lru.go +++ b/lrucache/lru.go @@ -58,9 +58,7 @@ func (c *lrucache) Range(f func(key, value int) bool) { } func (c *lrucache) Clear() { - for k := range c.data { - delete(c.data, k) - } + clear(c.data) c.recentEntries.Init() }