Skip to content

Commit

Permalink
refactor: using slices.Contains to simplify the code (#2379)
Browse files Browse the repository at this point in the history
Signed-off-by: piguagua <[email protected]>
  • Loading branch information
piguagua authored Jan 17, 2025
1 parent dc1ead2 commit fdedeb8
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions utils/slices.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,5 @@ func All[T any](slice []T, f func(T) bool) bool {
}

func AnyOf[T comparable](e T, values ...T) bool {
for _, v := range values {
if e == v {
return true
}
}
return false
return slices.Contains(values, e)
}

0 comments on commit fdedeb8

Please sign in to comment.