Skip to content
Snippets Groups Projects
Commit 31a5689d authored by floitsch@google.com's avatar floitsch@google.com
Browse files

Add Iterable.fold (and Stream.fold) which replace `reduce`.

For now this is just a copy. In a next step we will change the behavior of
`reduce`.

BUG= http://dartbug.com/9536

Review URL: https://codereview.chromium.org//13548002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@20978 260f80e4-7a28-3924-810f-c04153c831b5
parent f0487a4e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment