dG
02/04/2019, 3:51 PMpublic 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
}
Why is the first if
statement there? Is this for speed reasons?