Find xs.toList().forEach { … } patterns
ProprietaryIterable.forEach already iterates without materializing a list. The intermediate toList() allocates a copy that's read once and discarded.
org. openrewrite. kotlin. bestpractices. FindToListBeforeForEach$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. bestpractices. FindToListBeforeForEach$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.