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

Unified Diff: sdk/lib/core/map.dart

Issue 22859069: Reapply "Make Map constructors return LinkedHashMap." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make map_values2_test know the order. Created 7 years, 4 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 | « sdk/lib/collection/linked_hash_map.dart ('k') | tests/corelib/linked_hash_map_from_iterable_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/core/map.dart
diff --git a/sdk/lib/core/map.dart b/sdk/lib/core/map.dart
index e5ccb8777fbca825bd982bf8f44c8d024ee70e2c..79e81e4c5a369de9d8a5dc218af24118c2cbdc88 100644
--- a/sdk/lib/core/map.dart
+++ b/sdk/lib/core/map.dart
@@ -15,12 +15,12 @@ abstract class Map<K, V> {
/**
* Creates a Map instance with the default implementation.
*/
- factory Map() => new HashMap<K, V>();
+ factory Map() = LinkedHashMap<K, V>;
/**
* Creates a Map instance that contains all key-value pairs of [other].
*/
- factory Map.from(Map<K, V> other) => new HashMap<K, V>.from(other);
+ factory Map.from(Map<K, V> other) = LinkedHashMap<K, V>.from;
/**
* Creates a Map instance
@@ -29,7 +29,7 @@ abstract class Map<K, V> {
* For each element of the [iterable] this constructor computes a key-value
* pair, by applying [key] and [value] respectively.
*
- * The keys computed by the source [iterable]
+ * The keys computed by the source [iterable]
* do not need to be unique. The last
* occurrence of a key will simply overwrite any previous value.
*
@@ -37,7 +37,7 @@ abstract class Map<K, V> {
* identity function.
*/
factory Map.fromIterable(Iterable<K> iterable,
- {K key(element), V value(element)}) = HashMap<K, V>.fromIterable;
+ {K key(element), V value(element)}) = LinkedHashMap<K, V>.fromIterable;
/**
* Creates a Map instance associating the given [keys] to [values].
@@ -51,7 +51,7 @@ abstract class Map<K, V> {
* It is an error if the two [Iterable]s don't have the same length.
*/
factory Map.fromIterables(Iterable<K> keys, Iterable<V> values)
- = HashMap<K, V>.fromIterables;
+ = LinkedHashMap<K, V>.fromIterables;
/**
* Returns true if this map contains the given value.
« no previous file with comments | « sdk/lib/collection/linked_hash_map.dart ('k') | tests/corelib/linked_hash_map_from_iterable_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698