kyaml/sets: preallocate memory

Signed-off-by: Florian Lehner <dev@der-flo.net>
This commit is contained in:
Florian Lehner
2022-10-06 05:37:41 +02:00
parent 506dc4f9fe
commit 0fbaa2d0e8

View File

@@ -10,7 +10,7 @@ func (s String) Len() int {
}
func (s String) List() []string {
var val []string
val := make([]string, 0, len(s))
for k := range s {
val = append(val, k)
}