Use last() instead of reversed().first()

Proprietary

reversed() allocates an intermediate reversed copy. last() walks to the same element directly.

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