Introduce compat source sets and move all kotlin sources to the main directory [no changelog]
12 lines
207 B
Kotlin
12 lines
207 B
Kotlin
|
|
|
|
package moe.nea.firmament.util
|
|
|
|
fun <T : Any> T.iterate(iterator: (T) -> T?): Sequence<T> = sequence {
|
|
var x: T? = this@iterate
|
|
while (x != null) {
|
|
yield(x)
|
|
x = iterator(x)
|
|
}
|
|
}
|