Use any { predicate } instead of filter { predicate }.any()
Proprietaryany { predicate } short-circuits on the first match. Calling any() after filter first materializes the entire filtered list.
org. openrewrite. kotlin. performance. UseAnyWithPredicateInsteadOfFilterAny$KtRecipemod 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.