Use singleOrNull { predicate } instead of filter { predicate }.singleOrNull()
ProprietaryFolding the predicate into singleOrNull avoids materializing the intermediate filtered list.
org. openrewrite. kotlin. performance. UseSingleOrNullWithPredicate$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. UseSingleOrNullWithPredicate$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.