From 72b022eb357a56469725dcd03918449e2278d02e Mon Sep 17 00:00:00 2001 From: Vivek V Date: Wed, 9 Oct 2019 19:06:40 +0530 Subject: [PATCH] Added capacity to slice creation --- viper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/viper.go b/viper.go index 5133de7..e9010bc 100644 --- a/viper.go +++ b/viper.go @@ -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) }