Get rid of platform differences in Array.orEmpty() doc
This commit is contained in:
committed by
Space
parent
cc3c33b8ae
commit
91d1baf3b5
@@ -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>()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user