HasAny introduced

This commit is contained in:
milarin 2022-12-19 18:07:43 +01:00
parent 79805d1fdc
commit ba2efffd8e

View File

@ -30,3 +30,11 @@ func FindLast[T any](source <-chan T) *T {
return last
}
func HasAny[T any](source <-chan T) bool {
return FindFirst(source) != nil
}
func HasAnyAndFlush[T any](source <-chan T) bool {
return FindFirstAndFlush(source) != nil
}