stream: remove redundant method check from iter.pipeToSync

Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
PR-URL: https://github.com/nodejs/node/pull/63099
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
René authored and GitHub committed 2026-05-05 12:46:54 +00:00
1 parent 60e4f7b252
commit 6df4f7bf27
1 file changed
+1 -6
+1 -6
View File
@@ -764,7 +764,6 @@ function pipeToSync(source, ...args) {
normalized;
let totalBytes = 0;
const hasWriteSync = typeof writer.writeSync === 'function';
const hasWritevSync = typeof writer.writevSync === 'function';
const hasEndSync = typeof writer.endSync === 'function';
@@ -778,11 +777,7 @@ function pipeToSync(source, ...args) {
} else {
for (let i = 0; i < batch.length; i++) {
const chunk = batch[i];
if (hasWriteSync) {
writer.writeSync(chunk);
} else {
writer.write(chunk);
}
writer.writeSync(chunk);
totalBytes += TypedArrayPrototypeGetByteLength(chunk);
}
}