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

Unified Diff: lib/src/stream_splitter.dart

Issue 1841223002: Fix most strong mode warnings. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Code review changes Created 4 years, 9 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 | « lib/src/stream_sink_transformer/handler_transformer.dart ('k') | lib/src/stream_zip.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/stream_splitter.dart
diff --git a/lib/src/stream_splitter.dart b/lib/src/stream_splitter.dart
index ec648aad1c42fd58c265a97a99f6d4149f4fc110..448fe2a26ea926e2d3b75b3c5685bdb92b62bb80 100644
--- a/lib/src/stream_splitter.dart
+++ b/lib/src/stream_splitter.dart
@@ -57,10 +57,11 @@ class StreamSplitter<T> {
///
/// [count] defaults to 2. This is the same as creating [count] branches and
/// then closing the [StreamSplitter].
- static List<Stream> splitFrom(Stream stream, [int count]) {
+ static List<Stream/*<T>*/> splitFrom/*<T>*/(Stream/*<T>*/ stream,
+ [int count]) {
if (count == null) count = 2;
- var splitter = new StreamSplitter(stream);
- var streams = new List.generate(count, (_) => splitter.split());
+ var splitter = new StreamSplitter/*<T>*/(stream);
+ var streams = new List<Stream>.generate(count, (_) => splitter.split());
splitter.close();
return streams;
}
@@ -75,12 +76,11 @@ class StreamSplitter<T> {
throw new StateError("Can't call split() on a closed StreamSplitter.");
}
- var controller;
- controller = new StreamController<T>(
+ var controller = new StreamController<T>(
onListen: _onListen,
onPause: _onPause,
- onResume: _onResume,
- onCancel: () => _onCancel(controller));
+ onResume: _onResume);
+ controller.onCancel = () => _onCancel(controller);
for (var result in _buffer) {
result.addTo(controller);
« no previous file with comments | « lib/src/stream_sink_transformer/handler_transformer.dart ('k') | lib/src/stream_zip.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698