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

commonMain.ovh.plrapps.mapcompose.utils.Collections.kt Maven / Gradle / Ivy

Go to download

A Compose Multiplatform library to display tiled maps, with support for markers, paths, and rotation

The newest version!
package ovh.plrapps.mapcompose.utils

fun  MutableCollection.removeFirst(predicate: (T) -> Boolean): Boolean {
    var removed = false
    val it = iterator()
    while (it.hasNext()) {
        if (predicate(it.next())) {
            it.remove()
            removed = true
            break
        }
    }
    return removed
}

fun  MutableList.swap(i1: Int, i2: Int): MutableList = apply {
    val t = this[i1]
    this[i1] = this[i2]
    this[i2] = t
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy