Find xs.toList().forEach { … } patterns

Proprietary

Iterable.forEach already iterates without materializing a list. The intermediate toList() allocates a copy that's read once and discarded.

org.openrewrite.kotlin.bestpractices.FindToListBeforeForEach$KtRecipe
mod 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.