Added capacity to slice creation

This commit is contained in:
Vivek V 2019-10-09 19:06:40 +05:30 committed by Márk Sági-Kazár
parent 40e41dd224
commit 72b022eb35
1 changed files with 1 additions and 1 deletions

View File

@ -1723,7 +1723,7 @@ func (v *Viper) AllKeys() []string {
m = v.flattenAndMergeMap(m, v.defaults, "") m = v.flattenAndMergeMap(m, v.defaults, "")
// convert set of paths to list // convert set of paths to list
a := []string{} a := make([]string, 0, len(m))
for x := range m { for x := range m {
a = append(a, x) a = append(a, x)
} }