A lot of the Kotlin collection extension functions...
# javascript
d
A lot of the Kotlin collection extension functions try to optimize by doing an
is
check, e.g.:
Copy code
public inline fun <T> Iterable<T>.any(predicate: (T) -> Boolean): Boolean {
    if (this is Collection && isEmpty()) return false
    for (element in this) if (predicate(element)) return true
    return false
}
This is horrible for performance in JS because
is
is incredibly slow. I can't find any issues about this on the tracker, but I was wondering if anyone knows anything about this before I create an issue? Also would changing these functions be a big perf regression on other platforms?
⬆️ 2