From 223a970673374c13cc9dacc4c83951170dc67f46 Mon Sep 17 00:00:00 2001 From: Renegade334 Date: Sun, 3 May 2026 14:32:26 +0200 Subject: [PATCH] stream: remove redundant method check from iter.pipeToSync Signed-off-by: Renegade334 --- lib/internal/streams/iter/pull.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/internal/streams/iter/pull.js b/lib/internal/streams/iter/pull.js index df5ca2826a9ac5..a228f052a8e433 100644 --- a/lib/internal/streams/iter/pull.js +++ b/lib/internal/streams/iter/pull.js @@ -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); } }