Skip to content

Commit e9a8b81

Browse files
committed
stream: fixup sync pull batching in stream/new
1 parent be1b7c3 commit e9a8b81

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/internal/streams/new/pull.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,14 +285,14 @@ function* applyStatelessSyncTransform(source, transform) {
285285
*/
286286
function* applyStatefulSyncTransform(source, transform) {
287287
const output = transform(source);
288-
const batch = [];
289288
for (const item of output) {
289+
const batch = [];
290290
for (const chunk of flattenTransformYieldSync(item)) {
291291
ArrayPrototypePush(batch, chunk);
292292
}
293-
}
294-
if (batch.length > 0) {
295-
yield batch;
293+
if (batch.length > 0) {
294+
yield batch;
295+
}
296296
}
297297
}
298298

0 commit comments

Comments
 (0)