Skip to content

Commit b52868c

Browse files
authored
section: preallocate the size of keys hash (#297)
1 parent f8a14ab commit b52868c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

section.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ func (s *Section) KeysHash() map[string]string {
217217
defer s.f.lock.RUnlock()
218218
}
219219

220-
hash := map[string]string{}
220+
hash := make(map[string]string, len(s.keysHash))
221221
for key, value := range s.keysHash {
222222
hash[key] = value
223223
}

0 commit comments

Comments
 (0)