mirror of
https://github.com/nodejs/node.git
synced 2026-10-28 18:25:13 +08:00
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:
1 file changed
+1
-6
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user