Use min() instead of sortedDescending().last()

Proprietary

sortedDescending().last() does an O(n log n) sort just to read the minimum. min() finds it in a single linear pass.

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