-
-
Notifications
You must be signed in to change notification settings - Fork 37.7k
stream: simplify checks for highWaterMark #19893
Copy link
Copy link
Closed
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
Description
Activity
Metadata
Metadata
Assignees
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.streamIssues and PRs related to Node.js streams.Issues and PRs related to Node.js streams.
In
lib/_streams_readable.js, we have a block of code like this:Because
state.highWaterMarkcould be< 0ornullorundefinedor really any object in Node < 10. However, we landed #18098 and so now we can simplify all those checks to bestate.length <= state.highWaterMark.