Skip to content

Commit

Permalink
section: preallocate the size of keys hash (#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon authored Sep 4, 2021
1 parent f8a14ab commit b52868c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion section.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b52868c

Please sign in to comment.