Introduce sumOf with various selector types
#KT-11253
This commit is contained in:
@@ -17483,6 +17483,744 @@ public inline fun CharArray.sumByDouble(selector: (Char) -> Double): Double {
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Array<out T>.sumOf(selector: (T) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ByteArray.sumOf(selector: (Byte) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ShortArray.sumOf(selector: (Short) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun IntArray.sumOf(selector: (Int) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun LongArray.sumOf(selector: (Long) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun FloatArray.sumOf(selector: (Float) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun DoubleArray.sumOf(selector: (Double) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun BooleanArray.sumOf(selector: (Boolean) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharArray.sumOf(selector: (Char) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Array<out T>.sumOf(selector: (T) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ByteArray.sumOf(selector: (Byte) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ShortArray.sumOf(selector: (Short) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun IntArray.sumOf(selector: (Int) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun LongArray.sumOf(selector: (Long) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun FloatArray.sumOf(selector: (Float) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun DoubleArray.sumOf(selector: (Double) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun BooleanArray.sumOf(selector: (Boolean) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharArray.sumOf(selector: (Char) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Array<out T>.sumOf(selector: (T) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ByteArray.sumOf(selector: (Byte) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ShortArray.sumOf(selector: (Short) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun IntArray.sumOf(selector: (Int) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun LongArray.sumOf(selector: (Long) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun FloatArray.sumOf(selector: (Float) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun DoubleArray.sumOf(selector: (Double) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun BooleanArray.sumOf(selector: (Boolean) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharArray.sumOf(selector: (Char) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Array<out T>.sumOf(selector: (T) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ByteArray.sumOf(selector: (Byte) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ShortArray.sumOf(selector: (Short) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun IntArray.sumOf(selector: (Int) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun LongArray.sumOf(selector: (Long) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun FloatArray.sumOf(selector: (Float) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun DoubleArray.sumOf(selector: (Double) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun BooleanArray.sumOf(selector: (Boolean) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharArray.sumOf(selector: (Char) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Array<out T>.sumOf(selector: (T) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ByteArray.sumOf(selector: (Byte) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ShortArray.sumOf(selector: (Short) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun IntArray.sumOf(selector: (Int) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun LongArray.sumOf(selector: (Long) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun FloatArray.sumOf(selector: (Float) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun DoubleArray.sumOf(selector: (Double) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun BooleanArray.sumOf(selector: (Boolean) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharArray.sumOf(selector: (Char) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
|
||||
*/
|
||||
|
||||
@@ -2293,6 +2293,88 @@ public inline fun <T> Iterable<T>.sumByDouble(selector: (T) -> Double): Double {
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the collection.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Iterable<T>.sumOf(selector: (T) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the collection.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Iterable<T>.sumOf(selector: (T) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the collection.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Iterable<T>.sumOf(selector: (T) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the collection.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Iterable<T>.sumOf(selector: (T) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the collection.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Iterable<T>.sumOf(selector: (T) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
|
||||
*/
|
||||
|
||||
@@ -1710,6 +1710,98 @@ public inline fun <T> Sequence<T>.sumByDouble(selector: (T) -> Double): Double {
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Sequence<T>.sumOf(selector: (T) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Sequence<T>.sumOf(selector: (T) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Sequence<T>.sumOf(selector: (T) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Sequence<T>.sumOf(selector: (T) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the sequence.
|
||||
*
|
||||
* The operation is _terminal_.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun <T> Sequence<T>.sumOf(selector: (T) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an original collection containing all the non-`null` elements, throwing an [IllegalArgumentException] if there are any `null` elements.
|
||||
*
|
||||
|
||||
@@ -1567,6 +1567,88 @@ public inline fun CharSequence.sumByDouble(selector: (Char) -> Double): Double {
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharSequence.sumOf(selector: (Char) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharSequence.sumOf(selector: (Char) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharSequence.sumOf(selector: (Char) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharSequence.sumOf(selector: (Char) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each character in the char sequence.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun CharSequence.sumOf(selector: (Char) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits this char sequence into a list of strings each not exceeding the given [size].
|
||||
*
|
||||
|
||||
@@ -7890,6 +7890,346 @@ public inline fun UShortArray.sumByDouble(selector: (UShort) -> Double): Double
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UIntArray.sumOf(selector: (UInt) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ULongArray.sumOf(selector: (ULong) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UByteArray.sumOf(selector: (UByte) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfDouble")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UShortArray.sumOf(selector: (UShort) -> Double): Double {
|
||||
var sum: Double = 0.toDouble()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UIntArray.sumOf(selector: (UInt) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ULongArray.sumOf(selector: (ULong) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UByteArray.sumOf(selector: (UByte) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UShortArray.sumOf(selector: (UShort) -> Int): Int {
|
||||
var sum: Int = 0.toInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UIntArray.sumOf(selector: (UInt) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ULongArray.sumOf(selector: (ULong) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UByteArray.sumOf(selector: (UByte) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfLong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UShortArray.sumOf(selector: (UShort) -> Long): Long {
|
||||
var sum: Long = 0.toLong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UIntArray.sumOf(selector: (UInt) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ULongArray.sumOf(selector: (ULong) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UByteArray.sumOf(selector: (UByte) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfUInt")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UShortArray.sumOf(selector: (UShort) -> UInt): UInt {
|
||||
var sum: UInt = 0.toUInt()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UIntArray.sumOf(selector: (UInt) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun ULongArray.sumOf(selector: (ULong) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UByteArray.sumOf(selector: (UByte) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the sum of all values produced by [selector] function applied to each element in the array.
|
||||
*/
|
||||
@SinceKotlin("1.4")
|
||||
@OptIn(kotlin.experimental.ExperimentalTypeInference::class)
|
||||
@OverloadResolutionByLambdaReturnType
|
||||
@kotlin.jvm.JvmName("sumOfULong")
|
||||
@ExperimentalUnsignedTypes
|
||||
@kotlin.internal.InlineOnly
|
||||
public inline fun UShortArray.sumOf(selector: (UShort) -> ULong): ULong {
|
||||
var sum: ULong = 0.toULong()
|
||||
for (element in this) {
|
||||
sum += selector(element)
|
||||
}
|
||||
return sum
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of pairs built from the elements of `this` array and the [other] array with the same index.
|
||||
* The returned list has length of the shortest collection.
|
||||
|
||||
Reference in New Issue
Block a user