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

Unified Diff: pkg/http/lib/src/utils.dart

Issue 11410086: Use iterator, moveNext(), current. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Address comments. Created 8 years, 1 month 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 | « no previous file | pkg/unittest/lib/mock.dart » ('j') | runtime/lib/array.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index 29d8f034c50d116793156e6fb8849b160af7d4f3..f3eece87976d63ded7a89704eee94ae91d207940 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -176,10 +176,10 @@ Future get async {
/// The return values of all [Future]s are discarded. Any errors will cause the
/// iteration to stop and will be piped through the return value.
Future forEachFuture(Iterable input, Future fn(element)) {
- var iterator = input.iterator();
+ var iterator = input.iterator;
Future nextElement(_) {
- if (!iterator.hasNext) return new Future.immediate(null);
- return fn(iterator.next()).chain(nextElement);
+ if (!iterator.moveNext()) return new Future.immediate(null);
+ return fn(iterator.current).chain(nextElement);
}
return nextElement(null);
}
« no previous file with comments | « no previous file | pkg/unittest/lib/mock.dart » ('j') | runtime/lib/array.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698