Skip to content

Commit b263f72

Browse files
committed
cleanup for loops
1 parent 4ca2e8b commit b263f72

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

cli/vibe.go

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package cli
55

66
import (
77
"fmt"
8+
"slices"
89

910
"github.com/coder/coder/v2/codersdk"
1011
"github.com/coder/serpent"
@@ -29,20 +30,8 @@ func (r *RootCmd) vibe() *serpent.Command {
2930

3031
aiTasks := []codersdk.WorkspaceAgentTask{}
3132
for _, resource := range workspace.LatestBuild.Resources {
32-
agents := resource.Agents
33-
if len(agents) == 0 {
34-
continue
35-
}
36-
37-
for _, agent := range agents {
38-
tasks := agent.Tasks
39-
if len(tasks) == 0 {
40-
continue
41-
}
42-
43-
for _, task := range tasks {
44-
aiTasks = append(aiTasks, task)
45-
}
33+
for _, agent := range resource.Agents {
34+
aiTasks = slices.Concat(aiTasks, agent.Tasks)
4635
}
4736
}
4837

0 commit comments

Comments
 (0)