Collections.sort without comparator now uses natural order.
#KT-9771 Fixed
This commit is contained in:
@@ -6,8 +6,10 @@ import java.util.*
|
||||
public object Collections {
|
||||
public fun max<T>(col: Collection<T>, comp: Comparator<in T>): T = java.util.max(col, comp)
|
||||
|
||||
public fun <T> sort(list: MutableList<T>): Unit = java.util.sort(list)
|
||||
@Deprecated("Use list.sort() instead.", ReplaceWith("list.sort()"))
|
||||
public fun <T: Comparable<T>> sort(list: MutableList<T>): Unit = java.util.sort(list, naturalOrder())
|
||||
|
||||
@Deprecated("Use list.sortWith(comparator) instead.", ReplaceWith("list.sortWith(comparator)"))
|
||||
public fun <T> sort(list: MutableList<T>, comparator: java.util.Comparator<in T>): Unit = java.util.sort(list, comparator)
|
||||
|
||||
@Deprecated("Use list.reverse() instead.", ReplaceWith("list.reverse()"))
|
||||
@@ -23,10 +25,7 @@ public object Collections {
|
||||
}
|
||||
|
||||
@library("collectionsMax")
|
||||
internal fun max<T>(col: Collection<T>, comp: Comparator<in T>): T = noImpl
|
||||
private fun max<T>(col: Collection<T>, comp: Comparator<in T>): T = noImpl
|
||||
|
||||
@library("collectionsSort")
|
||||
internal fun <T> sort(list: MutableList<T>): Unit = noImpl
|
||||
|
||||
@library("collectionsSort")
|
||||
internal fun <T> sort(list: MutableList<T>, comparator: java.util.Comparator<in T>): Unit = noImpl
|
||||
private fun <T> sort(list: MutableList<T>, comparator: Comparator<in T>): Unit = noImpl
|
||||
|
||||
Reference in New Issue
Block a user