Skip to content

Commit

Permalink
chore(store): use the built-in clear to clear the map (#23375)
Browse files Browse the repository at this point in the history
Signed-off-by: hidewrong <hidewrong@outlook.com>
  • Loading branch information
hidewrong authored Jan 14, 2025
1 parent ec744ec commit d2aa3c2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions store/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d2aa3c2

Please sign in to comment.