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 5918f34654

View file

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