Use single { predicate } instead of filter { predicate }.single()
ProprietaryFolding the predicate into single avoids materializing the intermediate filtered list and preserves the same throwing semantics on the no-match and multi-match cases.
org. openrewrite. kotlin. performance. UseSingleWithPredicate$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. UseSingleWithPredicate$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.