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

Unified Diff: runtime/lib/immutable_map.dart

Issue 14246008: Allow Object when doing lookups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type error. 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
Index: runtime/lib/immutable_map.dart
diff --git a/runtime/lib/immutable_map.dart b/runtime/lib/immutable_map.dart
index 3c5c72ecbf309c31bd3686c94d3c05b99cbbfd42..77127e5ca8e608895de4d71b91a9bd2b3f76ae2c 100644
--- a/runtime/lib/immutable_map.dart
+++ b/runtime/lib/immutable_map.dart
@@ -10,7 +10,7 @@ class ImmutableMap<K, V> implements Map<K, V> {
: kvPairs_ = keyValuePairs;
- V operator [](K key) {
+ V operator [](Object key) {
// TODO(hausner): Since the keys are sorted, we could do a binary
// search. But is it worth it?
for (int i = 0; i < kvPairs_.length - 1; i += 2) {
@@ -45,7 +45,7 @@ class ImmutableMap<K, V> implements Map<K, V> {
return new _ImmutableMapValueIterable<V>(this);
}
- bool containsKey(K key) {
+ bool containsKey(Object key) {
for (int i = 0; i < kvPairs_.length; i += 2) {
if (key == kvPairs_[i]) {
return true;
@@ -54,7 +54,7 @@ class ImmutableMap<K, V> implements Map<K, V> {
return false;
}
- bool containsValue(V value) {
+ bool containsValue(Object value) {
for (int i = 1; i < kvPairs_.length; i += 2) {
if (value == kvPairs_[i]) {
return true;
@@ -75,7 +75,7 @@ class ImmutableMap<K, V> implements Map<K, V> {
throw new UnsupportedError("Cannot clear unmodifiable Map");
}
- V remove(K key) {
+ V remove(Object key) {
throw new UnsupportedError("Cannot remove from unmodifiable Map");
}

Powered by Google App Engine
This is Rietveld 408576698