Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: runtime/lib/collection_patch.dart

Issue 915323002: Compact LinkedHashMap/Set implementation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/collection_sources.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/collection_patch.dart
===================================================================
--- runtime/lib/collection_patch.dart (revision 43834)
+++ 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 (LinkedHashMap._useCompactCached) {
+ return new _CompactLinkedHashSet<E>();
+ } else {
+ return new _LinkedHashSet<E>();
+ }
}
hashCode = _defaultHashCode;
} else {
« no previous file with comments | « no previous file | runtime/lib/collection_sources.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698