Skip to content

Commit

Permalink
Use yield* to be more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Oct 13, 2024
1 parent 077b44a commit 3f6c64a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/src/npy_bytetransformer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ class ByteTransformer extends StreamTransformerBase<Uint8List, Uint8List> {
@override
Stream<Uint8List> bind(Stream<List<int>> stream) async* {
if (bufferSize == null) {
await for (final chunk in stream) {
yield Uint8List.fromList(chunk);
}
yield* stream.map((chunk) => Uint8List.fromList(chunk));
return;
}

Expand Down

0 comments on commit 3f6c64a

Please sign in to comment.