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

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

Issue 124753002: Code cleanup (mostly io lib and some http lib). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/http/lib/src/utils.dart
diff --git a/pkg/http/lib/src/utils.dart b/pkg/http/lib/src/utils.dart
index d3a4307620121714b3ce208744703ce43c7534d4..3d21d0be43d8e6861fab8d00d93085e91963134e 100644
--- a/pkg/http/lib/src/utils.dart
+++ b/pkg/http/lib/src/utils.dart
@@ -199,22 +199,5 @@ void chainToCompleter(Future future, Completer completer) {
future.then(completer.complete, onError: completer.completeError);
}
-// TOOD(nweiz): Get rid of this once https://codereview.chromium.org/11293132/
-// is in.
-/// Runs [fn] for each element in [input] in order, moving to the next element
-/// only when the [Future] returned by [fn] completes. Returns a [Future] that
-/// completes when all elements have been processed.
-///
-/// 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;
- Future nextElement(_) {
- if (!iterator.moveNext()) return new Future.value();
- return fn(iterator.current).then(nextElement);
- }
- return nextElement(null);
-}
-
/// Like [Future.sync], but wraps the Future in [Chain.track] as well.
Future syncFuture(callback()) => Chain.track(new Future.sync(callback));

Powered by Google App Engine
This is Rietveld 408576698