Skip to content

Commit

Permalink
Create dynamic slices instead of specific length
Browse files Browse the repository at this point in the history
  • Loading branch information
davemay99 committed Oct 12, 2021
1 parent 0d4c7e6 commit ce62ab3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions command/operator_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func NodeClassPredictor(factory ApiClientFactory) complete.Predictor {
}

// Iterate over node classes looking for match
filtered := make([]string, len(classes))
filtered := []string{}
for class := range classes {
if strings.HasPrefix(class, a.Last) {
filtered = append(filtered, class)
Expand All @@ -253,8 +253,7 @@ func ServerPredictor(factory ApiClientFactory) complete.Predictor {
return []string{}
}

unfiltered := make([]string, len(members.Members))
filtered := unfiltered[:0]
filtered := []string{}

for _, member := range members.Members {
if strings.HasPrefix(member.Name, a.Last) {
Expand Down

0 comments on commit ce62ab3

Please sign in to comment.