refactor: use slices.Contains to simplify (#5468)

Signed-off-by: zhedazijingang <unwrap_or_else@outlook.com>
This commit is contained in:
zhedazijingang
2025-08-28 16:25:39 +08:00
committed by GitHub
parent 1bee41ddea
commit 2349ee1eef
4 changed files with 10 additions and 30 deletions

View File

@@ -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