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

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

Issue 1360053003: Fix some cases where Map.containsValue did not accept Object as argument. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/_internal/js_runtime/lib/constant_map.dart ('k') | sdk/lib/collection/splay_tree.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/maps.dart
diff --git a/sdk/lib/collection/maps.dart b/sdk/lib/collection/maps.dart
index 7945e7ea643411074c5e65769a5870c0733913c7..2f803883120f8e768b8d9757234104c3ba16e7db 100644
--- a/sdk/lib/collection/maps.dart
+++ b/sdk/lib/collection/maps.dart
@@ -60,7 +60,7 @@ abstract class MapMixin<K, V> implements Map<K, V> {
}
}
- bool containsValue(V value) {
+ bool containsValue(Object value) {
for (K key in keys) {
if (this[key] == value) return true;
}
@@ -218,18 +218,18 @@ class UnmodifiableMapView<K, V> =
* necessary to implement each particular operation.
*/
class Maps {
- static bool containsValue(Map map, value) {
+ static bool containsValue(Map map, Object value) {
for (final v in map.values) {
- if (value == v) {
+ if (v == value) {
return true;
}
}
return false;
}
- static bool containsKey(Map map, key) {
+ static bool containsKey(Map map, Object key) {
for (final k in map.keys) {
- if (key == k) {
+ if (k == key) {
return true;
}
}
« no previous file with comments | « sdk/lib/_internal/js_runtime/lib/constant_map.dart ('k') | sdk/lib/collection/splay_tree.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698