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

Side by Side Diff: utils/pub/yaml/model.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, 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/pub/version_solver.dart ('k') | utils/pub/yaml/yaml_map.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of yaml; 5 part of yaml;
6 6
7 // This file contains the node classes for the internal representations of YAML 7 // This file contains the node classes for the internal representations of YAML
8 // documents. These nodes are used for both the serialization tree and the 8 // documents. These nodes are used for both the serialization tree and the
9 // representation graph. 9 // representation graph.
10 10
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 if (!(super == other) || other is! _MappingNode) return false; 215 if (!(super == other) || other is! _MappingNode) return false;
216 if (content.length != other.content.length) return false; 216 if (content.length != other.content.length) return false;
217 for (var key in content.keys) { 217 for (var key in content.keys) {
218 if (!other.content.containsKey(key)) return false; 218 if (!other.content.containsKey(key)) return false;
219 if (content[key] != other.content[key]) return false; 219 if (content[key] != other.content[key]) return false;
220 } 220 }
221 return true; 221 return true;
222 } 222 }
223 223
224 String toString() { 224 String toString() {
225 var strContent = content.keys. 225 var strContent = content.keys
226 mappedBy((k) => '${k}: ${content[k]}') 226 .mappedBy((k) => '${k}: ${content[k]}')
227 .join(', '); 227 .join(', ');
228 return '$tag {$strContent}'; 228 return '$tag {$strContent}';
229 } 229 }
230 230
231 int get hashCode => super.hashCode ^ _hashCode(content); 231 int get hashCode => super.hashCode ^ _hashCode(content);
232 232
233 visit(_Visitor v) => v.visitMapping(this); 233 visit(_Visitor v) => v.visitMapping(this);
234 } 234 }
OLDNEW
« no previous file with comments | « utils/pub/version_solver.dart ('k') | utils/pub/yaml/yaml_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698