fix: specify size in some map allocations (#20764)

This commit is contained in:
Artur Melanchyk 2024-12-13 23:19:12 +01:00 committed by GitHub
parent 54ecce66f0
commit 68b004a48f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -256,7 +256,7 @@ func (z *erasureServerPools) NewNSLock(bucket string, objects ...string) RWLocke
// GetDisksID will return disks by their ID.
func (z *erasureServerPools) GetDisksID(ids ...string) []StorageAPI {
idMap := make(map[string]struct{})
idMap := make(map[string]struct{}, len(ids))
for _, id := range ids {
idMap[id] = struct{}{}
}

View File

@ -60,7 +60,7 @@ const (
// getCanonicalHeaders generate a list of request headers with their values
func getCanonicalHeaders(signedHeaders http.Header) string {
var headers []string
vals := make(http.Header)
vals := make(http.Header, len(signedHeaders))
for k, vv := range signedHeaders {
k = strings.ToLower(k)
headers = append(headers, k)