associateTo<K, V, M extends KtMutableMap<K, V> > method
Populates and returns the destination
mutable map with key-value pairs
provided by transform
function applied to each element of the given collection.
If any of two pairs would have the same key the last one gets added to the map.
Implementation
M associateTo<K, V, M extends KtMutableMap<K, V>>(
M destination, KtPair<K, V> Function(T) transform) {
for (final element in iter) {
final pair = transform(element);
destination.put(pair.first, pair.second);
}
return destination;
}