This commit is contained in:
parent
0be0b6b35b
commit
cdaa1c8abb
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue