refactor: use slices.Contains to simplify code (#6069)
Signed-off-by: weifanglab <weifanglab@outlook.com>
This commit is contained in:
parent
14a1c9a53b
commit
9fae524221
1 changed files with 2 additions and 6 deletions
|
|
@ -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…
Reference in a new issue