Skip to content

Commit 71a3ede

Browse files
committed
use Iter() to iterate over active pipelines
1 parent 4d79d25 commit 71a3ede

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pipeline/pipeline.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ func (ap *ActivePipelines) Contains(n string) bool {
168168
// RemoveDeletedPipelines removes the pipelines whose names are NOT
169169
// present in `existingPipelineNames` from the given ActivePipelines instance.
170170
func (ap *ActivePipelines) RemoveDeletedPipelines(existingPipelineNames []string) {
171-
for i, pipeline := range ap.Pipelines {
171+
var index int
172+
for pipeline := range ap.Iter() {
172173
found := false
173174
for _, name := range existingPipelineNames {
174175
if pipeline.Name == name {
@@ -177,8 +178,9 @@ func (ap *ActivePipelines) RemoveDeletedPipelines(existingPipelineNames []string
177178
}
178179
}
179180
if !found {
180-
ap.Remove(i)
181+
ap.Remove(index)
181182
}
183+
index++
182184
}
183185
}
184186

0 commit comments

Comments
 (0)