Fixed FindWhere type predicates
All checks were successful
ci / deploy (push) Successful in 51s

This commit is contained in:
Leon Mika 2025-07-29 22:07:20 +10:00
parent 0be0b6b35b
commit cdaa1c8abb

View file

@ -9,7 +9,7 @@ func Contains[T comparable](ts []T, needle T) bool {
return false
}
func FindWhere[T comparable](ts []T, predicate func(t T) bool) (T, bool) {
func FindWhere[T any](ts []T, predicate func(t T) bool) (T, bool) {
var zeroT T
for _, t := range ts {
@ -20,7 +20,7 @@ func FindWhere[T comparable](ts []T, predicate func(t T) bool) (T, bool) {
return zeroT, false
}
func FindWithIndexWhere[T comparable](ts []T, predicate func(t T) bool) (T, int, bool) {
func FindWithIndexWhere[T any](ts []T, predicate func(t T) bool) (T, int, bool) {
var zeroT T
for i, t := range ts {