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

ru.inforion.lab403.common.extensions.collections.kt Maven / Gradle / Ivy

There is a newer version: 0.3.5
Show newest version
@file:Suppress("NOTHING_TO_INLINE")

package ru.inforion.lab403.common.extensions

inline fun Iterable.forEachNotNull(block: (T) -> Unit) = forEach {
    if (it != null) block(it)
}

inline fun Array.forEachNotNull(block: (T) -> Unit) = forEach {
    if (it != null) block(it)
}

inline fun  collect(count: Int, item: (Int) -> T) = (0 until count).map(item)

inline fun collect(count: Int) = (0 until count).toList()




© 2015 - 2024 Weber Informatics LLC | Privacy Policy