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

Proprietary

Folding the predicate into first avoids materializing the intermediate filtered list and short-circuits on the first match.

org.openrewrite.kotlin.performance.UseFirstWithPredicate$KtRecipe
mod run . --recipe='org.openrewrite.kotlin.performance.UseFirstWithPredicate$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.