Use sumOf { selector } instead of map { selector }.sum()

Proprietary

sumOf accumulates the result directly without materializing the intermediate List<Int>.

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