Get rid of platform differences in Array.orEmpty() doc

This commit is contained in:
Abduqodiri Qurbonzoda
2021-05-31 01:58:01 +03:00
committed by Space
parent cc3c33b8ae
commit 91d1baf3b5
3 changed files with 12 additions and 3 deletions
@@ -7,7 +7,10 @@ package kotlin.collections
import kotlin.internal.PureReifiable
/** Returns the array if it's not `null`, or an empty array otherwise. */
/**
* Returns the array if it's not `null`, or an empty array otherwise.
* @sample samples.collections.Arrays.Usage.arrayOrEmpty
*/
public actual inline fun <reified T> Array<out T>?.orEmpty(): Array<out T> = this ?: emptyArray<T>()
internal fun checkCopyOfRangeArguments(fromIndex: Int, toIndex: Int, size: Int) {
@@ -7,7 +7,10 @@ package kotlin.collections
expect interface RandomAccess
/** Returns the array if it's not `null`, or an empty array otherwise. */
/**
* Returns the array if it's not `null`, or an empty array otherwise.
* @sample samples.collections.Arrays.Usage.arrayOrEmpty
*/
expect inline fun <reified T> Array<out T>?.orEmpty(): Array<out T>
@@ -8,7 +8,10 @@ package kotlin.collections
import kotlin.comparisons.naturalOrder
import kotlin.random.Random
/** Returns the array if it's not `null`, or an empty array otherwise. */
/**
* Returns the array if it's not `null`, or an empty array otherwise.
* @sample samples.collections.Arrays.Usage.arrayOrEmpty
*/
@kotlin.internal.InlineOnly
public actual inline fun <T> Array<out T>?.orEmpty(): Array<out T> = this ?: emptyArray<T>()