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

commonMain.fr.acinq.lightning.utils.collections.kt Maven / Gradle / Ivy

There is a newer version: 1.8.4
Show newest version
package fr.acinq.lightning.utils


fun  List.startsWith(prefix: List): Boolean = this.take(prefix.size) == prefix

fun >> Triple, Iterable, Iterable>.zippedTo(destination: C): C {
    val i1 = first.iterator()
    val i2 = second.iterator()
    val i3 = third.iterator()

    while (i1.hasNext() && i2.hasNext() && i3.hasNext()) destination.add(Triple(i1.next(), i2.next(), i3.next()))
    return destination
}

fun  Triple, Iterable, Iterable>.zipped(): List> =
    zippedTo(ArrayList())




© 2015 - 2024 Weber Informatics LLC | Privacy Policy