Skip to content

Commit

Permalink
Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
srawlins committed Mar 12, 2018
1 parent eea3b65 commit c5cac82
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions lib/src/collection/multimap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,24 +309,16 @@ class _WrappedMap<K, V, C extends Iterable<V>> implements Map<K, C> {
}

@override
Iterable<MapEntry<K, C>> get entries {
return keys.map((K key) => new MapEntry<K, C>(key, this[key]));
}
Iterable<MapEntry<K, C>> get entries => _multimap._map.entries;

@override
void addEntries(Iterable<MapEntry<K, C>> entries) {
throw new UnsupportedError("Insert unsupported on map view");
}

@override
Map<K2, C2> map<K2, C2>(MapEntry<K2, C2> transform(K key, C value)) {
var result = <K2, C2>{};
for (var key in this.keys) {
var entry = transform(key, this[key]);
result[entry.key] = entry.value;
}
return result;
}
Map<K2, C2> map<K2, C2>(MapEntry<K2, C2> transform(K key, C value)) =>
_multimap._map.map(transform);

@override
C update(K key, C update(C value), {C ifAbsent()}) {
Expand Down

0 comments on commit c5cac82

Please sign in to comment.