You can a sequence to avoid creating a temporary `...
# getting-started
k
You can a sequence to avoid creating a temporary
List
if you're going with
forEach
.
👍 1
s
In Kotlin
Sequence
are preferred way to preform lazy stream operations. As it not required Java 8, and included in Kotlin stdlib. You can obtain sequence from list via
asSequnece()
call like
listOf(1, 2, 3).asSequence()
k
My bad, thanks!
l
My brain actually converts
Stream -> Sequence
when I read it, so i didn’t even notice 😅
s
My too, but this is #getting-started 🙂
👍 1