Introduce operations on Arrays returning Arrays: reversedArray, sortedArray.
#KT-8711
This commit is contained in:
@@ -615,6 +615,13 @@ public fun ShortArray.sort(comparison: (Short, Short) -> Int): Unit {
|
||||
return noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the array inplace according to the order specified by the given [comparator] object.
|
||||
*/
|
||||
public fun <T> Array<out T>.sortWith(comparator: Comparator<in T>): Unit {
|
||||
sort { a, b -> comparator.compare(a, b) }
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a *typed* object array containing all of the elements of this primitive array.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user