Skip to content

stream: simplify checks for highWaterMark #19893

@mcollina

Description

@mcollina
  • Version: master
  • Platform: all
  • Subsystem: stream

In lib/_streams_readable.js, we have a block of code like this:

          (state.length < state.highWaterMark ||
           state.length === 0);

Because state.highWaterMark  could be < 0 or null or undefined or really any object in Node < 10. However, we landed #18098 and so now we can simplify all those checks to be state.length <= state.highWaterMark.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are suitable for first-time contributors.streamIssues and PRs related to the stream subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions