@@ -1467,6 +1467,8 @@ public inline fun CharArray.firstOrNull(predicate: (Char) -> Boolean): Char? {
1467
1467
1468
1468
/**
1469
1469
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1470
+ *
1471
+ * @sample samples.collections.Collections.Elements.getOrElse
1470
1472
*/
1471
1473
@kotlin.internal.InlineOnly
1472
1474
public inline fun <T> Array<out T>.getOrElse(index: Int, defaultValue: (Int) -> T): T {
@@ -1478,6 +1480,8 @@ public inline fun <T> Array<out T>.getOrElse(index: Int, defaultValue: (Int) ->
1478
1480
1479
1481
/**
1480
1482
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1483
+ *
1484
+ * @sample samples.collections.Collections.Elements.getOrElse
1481
1485
*/
1482
1486
@kotlin.internal.InlineOnly
1483
1487
public inline fun ByteArray.getOrElse(index: Int, defaultValue: (Int) -> Byte): Byte {
@@ -1489,6 +1493,8 @@ public inline fun ByteArray.getOrElse(index: Int, defaultValue: (Int) -> Byte):
1489
1493
1490
1494
/**
1491
1495
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1496
+ *
1497
+ * @sample samples.collections.Collections.Elements.getOrElse
1492
1498
*/
1493
1499
@kotlin.internal.InlineOnly
1494
1500
public inline fun ShortArray.getOrElse(index: Int, defaultValue: (Int) -> Short): Short {
@@ -1500,6 +1506,8 @@ public inline fun ShortArray.getOrElse(index: Int, defaultValue: (Int) -> Short)
1500
1506
1501
1507
/**
1502
1508
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1509
+ *
1510
+ * @sample samples.collections.Collections.Elements.getOrElse
1503
1511
*/
1504
1512
@kotlin.internal.InlineOnly
1505
1513
public inline fun IntArray.getOrElse(index: Int, defaultValue: (Int) -> Int): Int {
@@ -1511,6 +1519,8 @@ public inline fun IntArray.getOrElse(index: Int, defaultValue: (Int) -> Int): In
1511
1519
1512
1520
/**
1513
1521
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1522
+ *
1523
+ * @sample samples.collections.Collections.Elements.getOrElse
1514
1524
*/
1515
1525
@kotlin.internal.InlineOnly
1516
1526
public inline fun LongArray.getOrElse(index: Int, defaultValue: (Int) -> Long): Long {
@@ -1522,6 +1532,8 @@ public inline fun LongArray.getOrElse(index: Int, defaultValue: (Int) -> Long):
1522
1532
1523
1533
/**
1524
1534
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1535
+ *
1536
+ * @sample samples.collections.Collections.Elements.getOrElse
1525
1537
*/
1526
1538
@kotlin.internal.InlineOnly
1527
1539
public inline fun FloatArray.getOrElse(index: Int, defaultValue: (Int) -> Float): Float {
@@ -1533,6 +1545,8 @@ public inline fun FloatArray.getOrElse(index: Int, defaultValue: (Int) -> Float)
1533
1545
1534
1546
/**
1535
1547
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1548
+ *
1549
+ * @sample samples.collections.Collections.Elements.getOrElse
1536
1550
*/
1537
1551
@kotlin.internal.InlineOnly
1538
1552
public inline fun DoubleArray.getOrElse(index: Int, defaultValue: (Int) -> Double): Double {
@@ -1544,6 +1558,8 @@ public inline fun DoubleArray.getOrElse(index: Int, defaultValue: (Int) -> Doubl
1544
1558
1545
1559
/**
1546
1560
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1561
+ *
1562
+ * @sample samples.collections.Collections.Elements.getOrElse
1547
1563
*/
1548
1564
@kotlin.internal.InlineOnly
1549
1565
public inline fun BooleanArray.getOrElse(index: Int, defaultValue: (Int) -> Boolean): Boolean {
@@ -1555,6 +1571,8 @@ public inline fun BooleanArray.getOrElse(index: Int, defaultValue: (Int) -> Bool
1555
1571
1556
1572
/**
1557
1573
* Returns an element at the given [index] or the result of calling the [defaultValue] function if the [index] is out of bounds of this array.
1574
+ *
1575
+ * @sample samples.collections.Collections.Elements.getOrElse
1558
1576
*/
1559
1577
@kotlin.internal.InlineOnly
1560
1578
public inline fun CharArray.getOrElse(index: Int, defaultValue: (Int) -> Char): Char {
0 commit comments