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:
10
cmd/utils.go
10
cmd/utils.go
@@ -112,6 +112,16 @@ func getWriteQuorum(drive int) int {
|
||||
return quorum
|
||||
}
|
||||
|
||||
// cloneMSS will clone a map[string]string.
|
||||
// If input is nil an empty map is returned, not nil.
|
||||
func cloneMSS(v map[string]string) map[string]string {
|
||||
r := make(map[string]string, len(v))
|
||||
for k, v := range v {
|
||||
r[k] = v
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// URI scheme constants.
|
||||
const (
|
||||
httpScheme = "http"
|
||||
|
||||
Reference in New Issue
Block a user