Skip to content

Commit 72b022e

Browse files
vivekv96sagikazarmark
authored andcommitted
Added capacity to slice creation
1 parent 40e41dd commit 72b022e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

viper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ func (v *Viper) AllKeys() []string {
17231723
m = v.flattenAndMergeMap(m, v.defaults, "")
17241724

17251725
// convert set of paths to list
1726-
a := []string{}
1726+
a := make([]string, 0, len(m))
17271727
for x := range m {
17281728
a = append(a, x)
17291729
}

0 commit comments

Comments
 (0)