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

Unified Diff: sdk/lib/collection/hash_map.dart

Issue 12827018: Add a new implementation of HashMap that uses JS objects for its (multiple) hash tables. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Prefer local variable. Created 7 years, 9 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
Index: sdk/lib/collection/hash_map.dart
diff --git a/sdk/lib/collection/hash_map.dart b/sdk/lib/collection/hash_map.dart
index d90b4b9f0646c5ebbb689695696bf87f07a94d51..676c89268e91e0a102f397c718a658ef6d2e1eef 100644
--- a/sdk/lib/collection/hash_map.dart
+++ b/sdk/lib/collection/hash_map.dart
@@ -21,16 +21,18 @@ class _HashMapTable<K, V> extends _HashTable<K> {
}
class HashMap<K, V> implements Map<K, V> {
- final _HashMapTable<K, V> _hashTable;
+ final _HashMapTable<K, V> _hashTable = new _HashMapTable<K, V>();
- HashMap() : _hashTable = new _HashMapTable<K, V>() {
- _hashTable._container = this;
- }
+ external factory HashMap();
Ivan Posva 2013/03/22 16:32:47 Why stop here? There are plenty of other opportuni
kasperl 2013/03/22 16:36:01 I need to have this _internal hashTable object eve
factory HashMap.from(Map<K, V> other) {
return new HashMap<K, V>()..addAll(other);
}
+ HashMap._internal() {
+ _hashTable._container = this;
+ }
+
bool containsKey(K key) {
return _hashTable._get(key) >= 0;
}

Powered by Google App Engine
This is Rietveld 408576698