KT-16602: Improve mutable sorting samples, fix sample references

This commit is contained in:
Ilya Gorbunov
2019-07-12 21:26:38 +03:00
parent 38d26b1d92
commit 4fc942c5e9
5 changed files with 58 additions and 27 deletions
@@ -1818,7 +1818,7 @@ public fun <T> Array<out T>.sort(): Unit {
*
* The sort is _stable_. It means that equal elements preserve their order relative to each other after sorting.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArrayOfComparable
*/
public fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1827,7 +1827,7 @@ public fun <T> Array<out T>.sort(fromIndex: Int = 0, toIndex: Int = size): Unit
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1836,7 +1836,7 @@ public fun ByteArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1845,7 +1845,7 @@ public fun ShortArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1854,7 +1854,7 @@ public fun IntArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1863,7 +1863,7 @@ public fun LongArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1872,7 +1872,7 @@ public fun FloatArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)
@@ -1881,7 +1881,7 @@ public fun DoubleArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
/**
* Sorts a range in the array in-place.
*
* @sample samples.collections.Arrays.Sorting.sortRangeOfComparable
* @sample samples.collections.Arrays.Sorting.sortRangeOfArray
*/
public fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit {
java.util.Arrays.sort(this, fromIndex, toIndex)