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

Unified Diff: pkg/serialization/lib/src/serialization_helpers.dart

Issue 17379025: pkg/serialization: cleanup (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: A few more types tracking down my issue Created 7 years, 6 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 | « pkg/serialization/lib/src/format.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/serialization/lib/src/serialization_helpers.dart
diff --git a/pkg/serialization/lib/src/serialization_helpers.dart b/pkg/serialization/lib/src/serialization_helpers.dart
index 1f86a9777a60947afcec8382ed5095fbb7485936..714315591d8ea1642e8f3c0fc1f901521a1a2dc4 100644
--- a/pkg/serialization/lib/src/serialization_helpers.dart
+++ b/pkg/serialization/lib/src/serialization_helpers.dart
@@ -205,7 +205,7 @@ class IdentityMap<K, V> implements Map<K, V> {
}
}
- putIfAbsent(K key, Function ifAbsent) {
+ V putIfAbsent(K key, Function ifAbsent) {
var index = _indexOf(key);
if (index == -1) {
keys.add(key);
@@ -216,7 +216,7 @@ class IdentityMap<K, V> implements Map<K, V> {
}
}
- _indexOf(K key) {
+ int _indexOf(K key) {
// Go backwards on the guess that we are most likely to access the most
// recently added.
// Make strings and primitives unique
@@ -252,4 +252,10 @@ class IdentityMap<K, V> implements Map<K, V> {
// Note that this is doing an equality comparison.
bool containsValue(x) => values.contains(x);
+
+ void addAll(Map<K, V> other) {
+ other.forEach((K key, V value) {
+ this[key] = value;
+ });
+ }
}
« no previous file with comments | « pkg/serialization/lib/src/format.dart ('k') | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698