Use firstNotNullOfOrNull { f } instead of mapNotNull { f }.firstOrNull()
ProprietaryfirstNotNullOfOrNull short-circuits on the first non-null result. mapNotNull { f }.firstOrNull() walks the whole input.
org. openrewrite. kotlin. performance. UseFirstNotNullOfOrNullForMapFirstOrNull$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. UseFirstNotNullOfOrNullForMapFirstOrNull$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.