Use firstNotNullOf { f } instead of mapNotNull { f }.first()

Proprietary

firstNotNullOf short-circuits on the first non-null result. mapNotNull { f }.first() walks the whole input.

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