From 54c52f696c5382516f94c4b965cef7a81deb998e Mon Sep 17 00:00:00 2001 From: Gani Georgiev Date: Mon, 12 Dec 2022 15:58:56 +0200 Subject: [PATCH] set map size to the shallowCopy --- models/record.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/record.go b/models/record.go index a42e3119..ae7ba4af 100644 --- a/models/record.go +++ b/models/record.go @@ -426,7 +426,7 @@ func (m *Record) getNormalizeDataValueForDB(key string) any { // shallowCopy shallow copy data into a new map. func shallowCopy(data map[string]any) map[string]any { - result := map[string]any{} + result := make(map[string]any, len(data)) for k, v := range data { result[k] = v