chore(all): replace map key deletion loop with clear() (#21082)

This commit is contained in:
Name
2025-04-01 23:28:06 +08:00
committed by GitHub
parent e0c8738230
commit b1bc641105
5 changed files with 6 additions and 18 deletions

View File

@@ -647,9 +647,7 @@ func (sys *BucketMetadataSys) init(ctx context.Context, buckets []string) {
// Reset the state of the BucketMetadataSys.
func (sys *BucketMetadataSys) Reset() {
sys.Lock()
for k := range sys.metadataMap {
delete(sys.metadataMap, k)
}
clear(sys.metadataMap)
sys.Unlock()
}