refactor: use slices.Contains to simplify code (#6069)

Signed-off-by: weifanglab <weifanglab@outlook.com>
main
weifanglab 15 hours ago committed by GitHub
parent 14a1c9a53b
commit 9fae524221
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +1,7 @@
package scheduler
import (
"slices"
"strconv"
"strings"
"time"
@ -208,12 +209,7 @@ type listMatcher struct {
}
func (m *listMatcher) matches(value int) bool {
for _, v := range m.values {
if v == value {
return true
}
}
return false
return slices.Contains(m.values, value)
}
// stepMatcher matches values at regular intervals.

Loading…
Cancel
Save