section: preallocate the size of keys hash (#297)

This commit is contained in:
ᴜɴᴋɴᴡᴏɴ
2021-09-04 14:18:47 +08:00
committed by GitHub
parent f8a14abc12
commit b52868c71b
+1 -1
View File
@@ -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
}