that has to be super ineffecient, right?
# getting-started
u
that has to be super ineffecient, right?
t
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.sequences/sorted.html and https://kotlinlang.org/docs/reference/sequences.html#sequence-operations also helps. basically sorted is stateful, so it requires all elements from the sequence anyway.
I had no idea, but you can play around with some code in kotlin docs: https://kotlinlang.org/docs/reference/sequences.html#sequence add a
.sortedBy{ println("sort: $it"); 0 }
and you will see all elements being processed in
sortedBy