Performance: add preallocation for some slice/map (#57860)
This change preallocates slices and maps where the size of the data is known before the object is created. Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This commit is contained in:
co-authored by
Joe Blubaugh
parent
460be70261
commit
4d8287b319
@@ -185,7 +185,7 @@ func (s *QueryData) trace(ctx context.Context, q *models.Query) (context.Context
|
||||
}
|
||||
|
||||
func sdkHeaderToHttpHeader(headers map[string]string) http.Header {
|
||||
httpHeader := make(http.Header)
|
||||
httpHeader := make(http.Header, len(headers))
|
||||
for key, val := range headers {
|
||||
httpHeader[key] = []string{val}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user