mirror of
https://github.com/minio/minio.git
synced 2025-11-20 18:06:10 -05:00
Copy metadata before spawning goroutine + prealloc maps (#10458)
In `(*cacheObjects).GetObjectNInfo` copy the metadata before spawning a goroutine. Clean up a few map[string]string copies as well, reducing allocs and simplifying the code. Fixes #10426
This commit is contained in:
@@ -270,7 +270,7 @@ func removeStandardStorageClass(metadata map[string]string) map[string]string {
|
||||
// cleanMetadataKeys takes keyNames to be filtered
|
||||
// and returns a new map with all the entries with keyNames removed.
|
||||
func cleanMetadataKeys(metadata map[string]string, keyNames ...string) map[string]string {
|
||||
var newMeta = make(map[string]string)
|
||||
var newMeta = make(map[string]string, len(metadata))
|
||||
for k, v := range metadata {
|
||||
if contains(keyNames, k) {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user