2 ms·
You've got to be careful in Kotlin. if `list` is an actual `List`, `filter` and `map` will create intermediate lists. To avoid that you must use `list.asSequen
by brabel 5y ago
You've got to be careful in Kotlin. if `list` is an actual `List`, `filter` and `map` will create intermediate lists.
To avoid that you must use `list.asSequence().filter { .. }.map { .. }.toList()`.
- chess_buster 5y agoThen the code is not the same of what smalltalk does with #select:thenCollect: Smalltalk's Collection classes have a method #species which return what class to use as the new container.