zipTransform<R, V> method
Returns a list of values built from the elements of this
collection and the other
collection with the same index
using the provided transform
function applied to each pair of elements.
The returned list has length of the shortest collection.
Implementation
KtList<V> zipTransform<R, V>(
KtIterable<R> other, V Function(T a, R b) transform) {
final first = iterator();
final second = other.iterator();
final list = mutableListOf<V>();
while (first.hasNext() && second.hasNext()) {
list.add(transform(first.next(), second.next()));
}
return list;
}