Skip to content

Commit 6df4f7b

Browse files
authored
stream: remove redundant method check from iter.pipeToSync
Signed-off-by: Renegade334 <[email protected]> PR-URL: #63099 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 60e4f7b commit 6df4f7b

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

lib/internal/streams/iter/pull.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,6 @@ function pipeToSync(source, ...args) {
764764
normalized;
765765

766766
let totalBytes = 0;
767-
const hasWriteSync = typeof writer.writeSync === 'function';
768767
const hasWritevSync = typeof writer.writevSync === 'function';
769768
const hasEndSync = typeof writer.endSync === 'function';
770769

@@ -778,11 +777,7 @@ function pipeToSync(source, ...args) {
778777
} else {
779778
for (let i = 0; i < batch.length; i++) {
780779
const chunk = batch[i];
781-
if (hasWriteSync) {
782-
writer.writeSync(chunk);
783-
} else {
784-
writer.write(chunk);
785-
}
780+
writer.writeSync(chunk);
786781
totalBytes += TypedArrayPrototypeGetByteLength(chunk);
787782
}
788783
}

0 commit comments

Comments
 (0)