From 3f6c64a18022e672443640eeacba40e88f84ac56 Mon Sep 17 00:00:00 2001 From: minhqdao Date: Sun, 13 Oct 2024 22:54:35 +0700 Subject: [PATCH] Use yield* to be more concise --- lib/src/npy_bytetransformer.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/npy_bytetransformer.dart b/lib/src/npy_bytetransformer.dart index a2fb839..83ad69b 100644 --- a/lib/src/npy_bytetransformer.dart +++ b/lib/src/npy_bytetransformer.dart @@ -18,9 +18,7 @@ class ByteTransformer extends StreamTransformerBase { @override Stream bind(Stream> stream) async* { if (bufferSize == null) { - await for (final chunk in stream) { - yield Uint8List.fromList(chunk); - } + yield* stream.map((chunk) => Uint8List.fromList(chunk)); return; }