Use first() instead of reversed().last()
Proprietaryreversed() allocates an intermediate reversed copy. first() returns the same element directly.
org. openrewrite. kotlin. performance. UseFirstForReversedLast$KtRecipemod run . --recipe= 'org. openrewrite. kotlin. performance. UseFirstForReversedLast$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.