Skip to content

Commit

Permalink
refactor: using slices.Contains to simplify the code
Browse files Browse the repository at this point in the history
Signed-off-by: piguagua <[email protected]>
  • Loading branch information
piguagua committed Jan 15, 2025
1 parent 27b6968 commit 7212e4d
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 7212e4d

Please sign in to comment.