Find map { ... }.filterNotNull() chains

Proprietary

Two-pass map { … }.filterNotNull() builds an intermediate list of nullable values. mapNotNull { … } does both in one pass with a single allocation and propagates null returns naturally.

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