Move Array.sortWith to generated code
This commit is contained in:
committed by
Vasily Levchenko
parent
38ca63418d
commit
bdcb90c3d4
@@ -1404,6 +1404,15 @@ public actual fun <T> Array<out T>.sortWith(comparator: Comparator<in T>): Unit
|
|||||||
if (size > 1) sortArrayWith(this, 0, size, comparator)
|
if (size > 1) sortArrayWith(this, 0, size, comparator)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sorts a range in the array in-place with the given [comparator].
|
||||||
|
*
|
||||||
|
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
|
||||||
|
*/
|
||||||
|
public fun <T> Array<out T>.sortWith(comparator: Comparator<in T>, fromIndex: Int = 0, toIndex: Int = size): Unit {
|
||||||
|
sortArrayWith(this, fromIndex, toIndex, comparator)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a *typed* object array containing all of the elements of this primitive array.
|
* Returns a *typed* object array containing all of the elements of this primitive array.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -19,16 +19,6 @@ public actual inline fun <reified T> Array<out T>?.orEmpty(): Array<out T> = thi
|
|||||||
throw IllegalArgumentException("fromIndex ($fromIndex) is greater than toIndex ($toIndex).")
|
throw IllegalArgumentException("fromIndex ($fromIndex) is greater than toIndex ($toIndex).")
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move to generated code
|
|
||||||
/**
|
|
||||||
* Sorts a range in the array in-place with the given [comparator].
|
|
||||||
*
|
|
||||||
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
|
|
||||||
*/
|
|
||||||
public fun <T> Array<out T>.sortWith(comparator: Comparator<in T>, fromIndex: Int = 0, toIndex: Int = size): Unit {
|
|
||||||
sortArrayWith(this, fromIndex, toIndex, comparator)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: internal
|
// TODO: internal
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user