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

Unified Diff: lib/src/stream_zip.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_splitter.dart ('k') | lib/src/subscription_stream.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/stream_zip.dart
diff --git a/lib/src/stream_zip.dart b/lib/src/stream_zip.dart
index 432cc22c29d8aaed15518cd6821f3ca3bf7df788..f9e20825a536c7526df4efa0e5a39b369fe9ba10 100644
--- a/lib/src/stream_zip.dart
+++ b/lib/src/stream_zip.dart
@@ -17,22 +17,22 @@ class StreamZip<T> extends Stream<List<T>> {
StreamZip(Iterable<Stream<T>> streams) : _streams = streams;
- StreamSubscription<List<T>> listen(void onData(List data), {
+ StreamSubscription<List<T>> listen(void onData(List<T> data), {
Function onError,
void onDone(),
bool cancelOnError}) {
cancelOnError = identical(true, cancelOnError);
- List<StreamSubscription> subscriptions = <StreamSubscription>[];
- StreamController controller;
- List current;
+ var subscriptions = <StreamSubscription<T>>[];
+ StreamController<List<T>> controller;
+ List<T> current;
int dataCount = 0;
/// Called for each data from a subscription in [subscriptions].
- void handleData(int index, data) {
+ void handleData(int index, T data) {
current[index] = data;
dataCount++;
if (dataCount == subscriptions.length) {
- List data = current;
+ var data = current;
current = new List(subscriptions.length);
dataCount = 0;
for (int i = 0; i < subscriptions.length; i++) {
@@ -70,7 +70,7 @@ class StreamZip<T> extends Stream<List<T>> {
}
try {
- for (Stream stream in _streams) {
+ for (var stream in _streams) {
int index = subscriptions.length;
subscriptions.add(stream.listen(
(data) { handleData(index, data); },
@@ -87,7 +87,7 @@ class StreamZip<T> extends Stream<List<T>> {
current = new List(subscriptions.length);
- controller = new StreamController<List>(
+ controller = new StreamController<List<T>>(
onPause: () {
for (int i = 0; i < subscriptions.length; i++) {
// This may pause some subscriptions more than once.
« no previous file with comments | « lib/src/stream_splitter.dart ('k') | lib/src/subscription_stream.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698