Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d34cfb5

Browse filesBrowse files
Renegade334aduh95
authored andcommitted
stream: remove redundant method check from iter.pipeToSync
Signed-off-by: Renegade334 <contact.9a5d6388@renegade334.me.uk> PR-URL: #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>
1 parent 30c4b36 commit d34cfb5
Copy full SHA for d34cfb5

1 file changed

+1-6Lines changed: 1 addition & 6 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/streams/iter/pull.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/iter/pull.js
+1-6Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.