Why does the combine operator of flow works with a...
# coroutines
s
Why does the combine operator of flow works with arrays(instead of list or iterator)? From source code:
Copy code
public inline fun <reified T, R> combine(
    flows: Iterable<Flow<T>>,
    crossinline transform: suspend (Array<T>) -> R
): Flow<R> {
    val flowArray = flows.toList().toTypedArray()
    return flow {
        combineInternal(
            flowArray,
            arrayFactory = { arrayOfNulls(flowArray.size) },
            transform = { emit(transform(it)) })
    }
}
l
May be to use System.arraycopy? I am curious too
👍 1
s