mapTo<R, C extends KtMutableCollection<R>> method

C mapTo<R, C extends KtMutableCollection<R>>(
  1. C destination,
  2. R transform(
    1. T
    )
)

Applies the given transform function to each element of the original collection and appends the results to the given destination.

Implementation

C mapTo<R, C extends KtMutableCollection<R>>(
    C destination, R Function(T) transform) {
  for (final item in iter) {
    destination.add(transform(item));
  }
  return destination;
}