File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -300,22 +300,20 @@ class StreamGroup<T> implements Sink<Stream<T>> {
300300 // For a broadcast group that's closed, we must listen to streams with
301301 // null subscriptions to detect when they complete. This ensures the
302302 // group itself can close once all its streams have closed.
303- final streamsToRemove = < Stream <T >> [] ;
303+ List <Stream <T >>? streamsToRemove ;
304304
305305 _subscriptions.updateAll ((stream, subscription) {
306306 if (subscription != null ) return subscription;
307307
308308 try {
309309 return _listenToStream (stream);
310310 } on Object {
311- streamsToRemove.add (stream);
311+ ( streamsToRemove ?? = []) .add (stream);
312312 return null ;
313313 }
314314 });
315315
316- for (final stream in streamsToRemove) {
317- _subscriptions.remove (stream);
318- }
316+ streamsToRemove? .forEach (_subscriptions.remove);
319317 }
320318
321319 return _controller.done;
You can’t perform that action at this time.
0 commit comments