From a8830b5816669717415ca71f6e3740227a9a56fa Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Tue, 6 Oct 2015 22:01:07 +0300 Subject: [PATCH] sortedByDescending { key } instead of sortedBy { -key } --- .../frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt | 2 +- j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt index a6b75629d38..2d0502ceec7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt @@ -142,7 +142,7 @@ public fun createByPattern(pattern: String, vararg args: .flatMap { it.value } .map { it.range } .filterNot { it.isEmpty() } - .sortedBy { -it.getStartOffset() } + .sortedByDescending { it.startOffset } // reformat whole text except for String arguments (as they can contain user's formatting to be preserved) if (stringPlaceholderRanges.none()) { diff --git a/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt b/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt index 06ba1fd008d..8202267e7bd 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/OverloadReducer.kt @@ -143,7 +143,7 @@ class OverloadReducer( private fun dropOverloadsForDefaultValues(equivalenceMap: Map) { val dropCandidates = equivalenceMap .map { it.key } - .sortedBy { -it.getParameterList().getParametersCount() } // we will try to drop them starting from ones with more parameters + .sortedByDescending { it.parameterList.parametersCount } // we will try to drop them starting from ones with more parameters DropCandidatesLoop@ for (method in dropCandidates) {