All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.SumOf.kt Maven / Gradle / Ivy

package com.juul.krayon.hierarchy

/** Fills weird gap in standard library. Copy-paste of `sumOf` but all [Double] changed to [Float]. */
@PublishedApi
internal inline fun  Iterable.sumOf(selector: (T) -> Float): Float {
    var sum = 0f
    for (element in this) {
        sum += selector(element)
    }
    return sum
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy