Skip to content

Commit

Permalink
Merge pull request #4820 from florianl/flo-preallocate
Browse files Browse the repository at this point in the history
preallocate memory
  • Loading branch information
k8s-ci-robot committed Oct 21, 2022
2 parents bf7a0f9 + c2312c4 commit ccb68aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion kyaml/sets/string.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion kyaml/yaml/filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (y *YFilter) UnmarshalYAML(unmarshal func(interface{}) error) error {
type YFilters []YFilter

func (y YFilters) Filters() []Filter {
var f []Filter
f := make([]Filter, 0, len(y))
for i := range y {
f = append(f, y[i].Filter)
}
Expand Down

0 comments on commit ccb68aa

Please sign in to comment.