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

Unified Diff: utils/template/utils.dart

Issue 11230011: Make hasNext a getter instead of a method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused variable. Created 8 years, 2 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/utils.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/template/utils.dart
diff --git a/utils/template/utils.dart b/utils/template/utils.dart
index 97aa3d2e9425ad47dabc0b5ce8ac6dafddb49d63..dcd19424bb97aa8ee1dfd85d4fea6f5b05409b6d 100644
--- a/utils/template/utils.dart
+++ b/utils/template/utils.dart
@@ -27,10 +27,10 @@ reduce(Iterable source, callback, [initialValue]) {
final i = source.iterator();
var current = initialValue;
- if (current == null && i.hasNext()) {
+ if (current == null && i.hasNext) {
current = i.next();
}
- while (i.hasNext()) {
+ while (i.hasNext) {
current = callback(current, i.next());
}
return current;
@@ -40,10 +40,10 @@ List zip(Iterable left, Iterable right, mapper(left, right)) {
List result = new List();
var x = left.iterator();
var y = right.iterator();
- while (x.hasNext() && y.hasNext()) {
+ while (x.hasNext && y.hasNext) {
result.add(mapper(x.next(), y.next()));
}
- if (x.hasNext() || y.hasNext()) {
+ if (x.hasNext || y.hasNext) {
throw new ArgumentError();
}
return result;
« no previous file with comments | « utils/pub/utils.dart ('k') | utils/tests/pub/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698