Skip to content

Commit 2560af7

Browse files
harryterkelsenmhevery
authored andcommitted
refactor(dart): use Map instead of HashMap
Closes angular#1202
1 parent 86211eb commit 2560af7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

modules/angular2/src/facade/collection.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
library facade.collection;
22

3-
import 'dart:collection' show HashMap, IterableBase, Iterator;
3+
import 'dart:collection' show IterableBase, Iterator;
44
export 'dart:core' show Map, List, Set;
55
import 'dart:math' show max, min;
66

@@ -30,10 +30,10 @@ class IterableMap extends IterableBase<List> {
3030
}
3131

3232
class MapWrapper {
33-
static HashMap create() => new HashMap();
34-
static HashMap clone(Map m) => new HashMap.from(m);
35-
static HashMap createFromStringMap(Map m) => new Map.from(m);
36-
static HashMap createFromPairs(List pairs) => pairs.fold({}, (m, p) {
33+
static Map create() => {};
34+
static Map clone(Map m) => new Map.from(m);
35+
static Map createFromStringMap(Map m) => m;
36+
static Map createFromPairs(List pairs) => pairs.fold({}, (m, p) {
3737
m[p[0]] = p[1];
3838
return m;
3939
});
@@ -63,7 +63,7 @@ class MapWrapper {
6363
}
6464

6565
class StringMapWrapper {
66-
static HashMap create() => new HashMap();
66+
static Map create() => {};
6767
static bool contains(Map map, key) => map.containsKey(key);
6868
static get(Map map, key) => map[key];
6969
static void set(Map map, key, value) {
@@ -75,8 +75,8 @@ class StringMapWrapper {
7575
static void forEach(Map m, fn(v, k)) {
7676
m.forEach((k, v) => fn(v, k));
7777
}
78-
static HashMap merge(Map a, Map b) {
79-
var m = new HashMap.from(a);
78+
static Map merge(Map a, Map b) {
79+
var m = new Map.from(a);
8080
b.forEach((k, v) => m[k] = v);
8181
return m;
8282
}

0 commit comments

Comments
 (0)