| Index: sdk/lib/_internal/compiler/implementation/lib/constant_map.dart
|
| diff --git a/sdk/lib/_internal/compiler/implementation/lib/constant_map.dart b/sdk/lib/_internal/compiler/implementation/lib/constant_map.dart
|
| index 4cb4049f1ba68e79e5a170cec4fdacf11d0cabcc..fabebbd9409216987699335fed2fef99fe1d1517 100644
|
| --- a/sdk/lib/_internal/compiler/implementation/lib/constant_map.dart
|
| +++ b/sdk/lib/_internal/compiler/implementation/lib/constant_map.dart
|
| @@ -30,12 +30,12 @@ class ConstantMap<V> implements Map<String, V> {
|
| _keys.forEach((String key) => f(key, this[key]));
|
| }
|
|
|
| - Collection<String> get keys => _keys;
|
| + Iterable<String> get keys {
|
| + return new _ConstantMapKeyIterable(this);
|
| + }
|
|
|
| - Collection<V> get values {
|
| - List<V> result = <V>[];
|
| - _keys.forEach((String key) => result.add(this[key]));
|
| - return result;
|
| + Iterable<V> get values {
|
| + return new MappedIterable<String, V>(_keys, (String key) => this[key]);
|
| }
|
|
|
| bool get isEmpty => length == 0;
|
| @@ -66,3 +66,10 @@ class ConstantProtoMap<V> extends ConstantMap<V> {
|
| return super[key];
|
| }
|
| }
|
| +
|
| +class _ConstantMapKeyIterable extends Iterable<String> {
|
| + ConstantMap _map;
|
| + _ConstantMapKeyIterable(this._map);
|
| +
|
| + Iterator<String> get iterator => _map._keys.iterator;
|
| +}
|
|
|