Use any { predicate } instead of filter { predicate }.any()

Proprietary

any { predicate } short-circuits on the first match. Calling any() after filter first materializes the entire filtered list.

org.openrewrite.kotlin.performance.UseAnyWithPredicateInsteadOfFilterAny$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.performance.UseAnyWithPredicateInsteadOfFilterAny$KtRecipe'

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.