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

Unified Diff: utils/pub/io.dart

Issue 13548002: Add Iterable.fold (and Stream.fold) which replace `reduce`. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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 | « tools/dom/templates/immutable_list_mixin.darttemplate ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index a0e69a9172ee038144b4bb04d82094bbdd9144b6..3eed22c0aa971b3a7e3c35dc7221df5348ebe2f2 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -328,7 +328,7 @@ Future<bool> confirm(String message) {
/// Reads and discards all output from [stream]. Returns a [Future] that
/// completes when the stream is closed.
Future drainStream(Stream stream) {
- return stream.reduce(null, (x, y) {});
+ return stream.fold(null, (x, y) {});
}
/// Returns a [EventSink] that pipes all data to [consumer] and a [Future] that
« no previous file with comments | « tools/dom/templates/immutable_list_mixin.darttemplate ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698