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

Unified Diff: samples/ui_lib/util/CollectionUtils.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 | « runtime/vm/parser.cc ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/ui_lib/util/CollectionUtils.dart
diff --git a/samples/ui_lib/util/CollectionUtils.dart b/samples/ui_lib/util/CollectionUtils.dart
index 8d633ea06f005f7c4196f2cb722359a6157d686e..30ad675dace5f8bd295f877194cdcc0dc88323a6 100644
--- a/samples/ui_lib/util/CollectionUtils.dart
+++ b/samples/ui_lib/util/CollectionUtils.dart
@@ -71,11 +71,11 @@ class CollectionUtils {
/** Compute the minimum of an iterable. Returns null if empty. */
static num min(Iterable source) {
final iter = source.iterator();
- if (!iter.hasNext()) {
+ if (!iter.hasNext) {
return null;
}
num best = iter.next();
- while (iter.hasNext()) {
+ while (iter.hasNext) {
best = Math.min(best, iter.next());
}
return best;
@@ -84,11 +84,11 @@ class CollectionUtils {
/** Compute the maximum of an iterable. Returns null if empty. */
static num max(Iterable source) {
final iter = source.iterator();
- if (!iter.hasNext()) {
+ if (!iter.hasNext) {
return null;
}
num best = iter.next();
- while (iter.hasNext()) {
+ while (iter.hasNext) {
best = Math.max(best, iter.next());
}
return best;
@@ -120,11 +120,11 @@ class CollectionUtils {
if (selector != null) {
do {
total += selector(iter.next());
- } while (iter.hasNext());
+ } while (iter.hasNext);
} else {
do {
total += iter.next();
- } while (iter.hasNext());
+ } while (iter.hasNext);
}
return total;
}
« no previous file with comments | « runtime/vm/parser.cc ('k') | tests/co19/co19-compiler.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698