Chromium Code Reviews| Index: runtime/lib/collection_patch.dart |
| =================================================================== |
| --- runtime/lib/collection_patch.dart (revision 43712) |
| +++ runtime/lib/collection_patch.dart (working copy) |
| @@ -918,6 +918,8 @@ |
| if (equals == null) { |
| if (_useInternalCached) { |
| return new _InternalLinkedHashMap<K, V>(); |
| + } else if (_useCompactCached) { |
| + return new _CompactLinkedHashMap<K, V>(); |
| } else { |
| return new _LinkedHashMap<K, V>(); |
| } |
| @@ -947,6 +949,8 @@ |
| static final bool _useInternalCached = _useInternal; |
| static bool get _useInternal native "LinkedHashMap_useInternal"; |
| + static final bool _useCompactCached = _useCompact; |
| + static bool get _useCompact native "LinkedHashMap_useCompact"; |
| } |
| // Methods that are exactly the same in all three linked hash map variants. |
| @@ -1063,7 +1067,11 @@ |
| if (isValidKey == null) { |
| if (hashCode == null) { |
| if (equals == null) { |
| - return new _LinkedHashSet<E>(); |
| + if (_useCompactCached) { |
|
Vyacheslav Egorov (Google)
2015/02/12 15:42:40
Any reason why you can't just do LinkedHashMap._us
koda
2015/02/17 17:26:28
Done.
|
| + return new _CompactLinkedHashSet<E>(); |
| + } else { |
| + return new _LinkedHashSet<E>(); |
| + } |
| } |
| hashCode = _defaultHashCode; |
| } else { |
| @@ -1087,6 +1095,9 @@ |
| } |
| /* patch */ factory LinkedHashSet.identity() = _LinkedIdentityHashSet<E>; |
| + |
| + static final bool _useCompactCached = _useCompact; |
| + static bool get _useCompact native "LinkedHashMap_useCompact"; |
| } |
| class _LinkedHashSetEntry extends _HashSetEntry { |