mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-05 09:41:14 +00:00
refactor: use slices.Contains to simplify (#5468)
Signed-off-by: zhedazijingang <unwrap_or_else@outlook.com>
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"container/list"
|
||||
"context"
|
||||
"fmt"
|
||||
"slices"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@@ -362,10 +363,8 @@ func (q *fifo) depsInQueue(task *model.Task) bool {
|
||||
}
|
||||
for possibleDepID := range q.running {
|
||||
log.Debug().Msgf("queue: running right now: %v", possibleDepID)
|
||||
for _, dep := range task.Dependencies {
|
||||
if possibleDepID == dep {
|
||||
return true
|
||||
}
|
||||
if slices.Contains(task.Dependencies, possibleDepID) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
Reference in New Issue
Block a user