From 5c3f0aa73ebc934ce46a8cb34568c964c68a21ae Mon Sep 17 00:00:00 2001 From: icylight <408209435@qq.com> Date: Sat, 20 Aug 2022 14:48:03 +0800 Subject: [PATCH] style(metadata): specify map capacity hints (#2296) --- metadata/metadata.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata/metadata.go b/metadata/metadata.go index be1806259..3dabdbaef 100644 --- a/metadata/metadata.go +++ b/metadata/metadata.go @@ -46,7 +46,7 @@ func (m Metadata) Range(f func(k, v string) bool) { // Clone returns a deep copy of Metadata func (m Metadata) Clone() Metadata { - md := Metadata{} + md := make(Metadata, len(m)) for k, v := range m { md[k] = v }