{ return filterTo(ArrayList<T>(), predicate) } public inline fun <T, C : MutableCollection<in T>> Iterable<T> .filterTo(destination: C, predicate: (T) -> Boolean): C { for (element in this) if (predicate(element)) destination.add(element) return destination } h"ps:/ /github.com/JetBrains/kotlin/blob/v1.1.1/libraries/stdlib/src/generated/_Collec=ons.kt>ΑΓ Πϯσϯτม͍͑ͯ·͢
{ val buffers = LinkedList<MutableList<T>>() var i = 0 forEach { element -> if (i.rem(skip) == 0) buffers.add(mutableListOf()) for (buffer in buffers) buffer.add(element) if (buffers.size > 0 && buffers.peek().count() == count) yield(buffers.poll().toList()) i++ } yieldAll(buffers) }