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

Unified Diff: sdk/lib/async/stream_pipe.dart

Issue 2481083003: Make `Stream.take(0)` still listen and close the stream. (Closed)
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_pipe.dart
diff --git a/sdk/lib/async/stream_pipe.dart b/sdk/lib/async/stream_pipe.dart
index 58acd4f8b47b23e5fdfbf55e2038515452bf9564..643d14227afca6b41cda51b7ede42bbf8ae8b465 100644
--- a/sdk/lib/async/stream_pipe.dart
+++ b/sdk/lib/async/stream_pipe.dart
@@ -327,6 +327,7 @@ class _TakeStream<T> extends _ForwardingStream<T, T> {
void onDone(),
bool cancelOnError) {
if (_count == 0) {
+ _source.listen(null).cancel();
return new _DoneStreamSubscription<T>(onDone);
}
return new _StateStreamSubscription<T>(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698