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

Unified Diff: utils/pub/yaml/yaml_map.dart

Issue 11664006: Make Map.keys/values Iterables. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Add TODO that map.keys should return a Set. Created 7 years, 12 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 | « utils/pub/yaml/model.dart ('k') | utils/template/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/yaml/yaml_map.dart
diff --git a/utils/pub/yaml/yaml_map.dart b/utils/pub/yaml/yaml_map.dart
index e80a98836a98a50a78a5c1ef51c090a519b69113..65dd11994f04684fa039b946fd65d1d861455534 100644
--- a/utils/pub/yaml/yaml_map.dart
+++ b/utils/pub/yaml/yaml_map.dart
@@ -29,8 +29,8 @@ class YamlMap implements Map {
void clear() => _map.clear();
void forEach(void f(key, value)) =>
_map.forEach((k, v) => f(_unwrapKey(k), v));
- Collection get keys => _map.keys.mappedBy(_unwrapKey).toList();
- Collection get values => _map.values;
+ Iterable get keys => _map.keys.mappedBy(_unwrapKey);
+ Iterable get values => _map.values;
int get length => _map.length;
bool get isEmpty => _map.isEmpty;
String toString() => _map.toString();
@@ -94,7 +94,7 @@ int _hashCode(obj, [List parents]) {
return _hashCode(obj.keys, parents) ^
_hashCode(obj.values, parents);
}
- if (obj is List) {
+ if (obj is Iterable) {
// This is probably a really bad hash function, but presumably we'll get
// this in the standard library before it actually matters.
int hash = 0;
« no previous file with comments | « utils/pub/yaml/model.dart ('k') | utils/template/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698