From d2aa3c25be6d9bc1af18c8cd980daa13b78ac553 Mon Sep 17 00:00:00 2001 From: hidewrong Date: Tue, 14 Jan 2025 18:21:06 +0800 Subject: [PATCH] chore(store): use the built-in clear to clear the map (#23375) Signed-off-by: hidewrong --- store/cache/cache.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/store/cache/cache.go b/store/cache/cache.go index 748eae8c42..787e34da20 100644 --- a/store/cache/cache.go +++ b/store/cache/cache.go @@ -84,9 +84,7 @@ func (cmgr *CommitKVStoreCacheManager) Reset() { // Clear the map. // Please note that we are purposefully using the map clearing idiom. // See https://github.com/cosmos/cosmos-sdk/issues/6681. - for key := range cmgr.caches { - delete(cmgr.caches, key) - } + clear(cmgr.caches) } // CacheWrap implements the CacheWrapper interface