From b52868c71b57dcbd66fa5e210a2cbf11e88e2427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=9C=C9=B4=E1=B4=8B=C9=B4=E1=B4=A1=E1=B4=8F=C9=B4?= Date: Sat, 4 Sep 2021 14:18:47 +0800 Subject: [PATCH] section: preallocate the size of keys hash (#297) --- section.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/section.go b/section.go index afaa97c..a3615d8 100644 --- a/section.go +++ b/section.go @@ -217,7 +217,7 @@ func (s *Section) KeysHash() map[string]string { defer s.f.lock.RUnlock() } - hash := map[string]string{} + hash := make(map[string]string, len(s.keysHash)) for key, value := range s.keysHash { hash[key] = value }