Dominaezzz
11/20/2019, 10:27 PMfun CharSequence.splitToSequences(
vararg delimiters: String,
ignoreCase: Boolean = false,
limit: Int = 0
): Sequence<CharSequence>
Hullaballoonatic
11/20/2019, 11:31 PMString::split
method with all the params that Collection::joinToString
has.Dominaezzz
11/20/2019, 11:33 PMsplitToSequence
returns String
instead of CharSequence
. Which means more allocations. 😞jimn
11/21/2019, 12:02 AMjimn
11/21/2019, 12:11 AMelizarov
11/21/2019, 3:18 PMDominaezzz
11/21/2019, 3:22 PMjimn
11/21/2019, 3:41 PMelizarov
11/21/2019, 3:43 PMjimn
11/21/2019, 3:46 PMmiha-x64
11/25/2019, 6:21 PMDominaezzz
11/25/2019, 6:25 PMasIterator()
solves that.miha-x64
11/25/2019, 7:11 PM.toSequence()
elizarov
11/25/2019, 7:22 PMIterator
. They are error-prone to work with. That is why Kotlin collections do not have any operators on iterators. Sequence
is multi-use, thus easier to reason about, since it has not intrinsic “state” (used/not-used) that a person using it has to keep in mind.miha-x64
11/25/2019, 7:46 PM.constrainOnce()
makes `Sequence`s even more unsafe.elizarov
11/25/2019, 8:08 PMFlow
. Most of them multi-use with limited exceptions