GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: remove redundant method check from iter.pipeToSync · nodejs/node@d34cfb5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/streams/iter
    • pull.js
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.