Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stream: delete unused code #18278

Conversation

MoonBall
Copy link
Member

@MoonBall MoonBall commented Jan 21, 2018

In implementation of stream.Writable, writable._write() is always called with a callback that is _writableState.onwrite(). And In afterTransform(), ts.writechunk and ts.writecb are assigned to null. So, ts.writecb is a true value if ts.writechunk isn't null.

From the view of stream.Writable, only ts.writecb can inform it about the end of writing chunk to the underlying. So a callback is essential to call writable._write(). So, ts.writecb is a true value if ts.writechunk isn't null.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

stream

In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null.  So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.
@nodejs-github-bot nodejs-github-bot added the stream Issues and PRs related to the stream subsystem. label Jan 21, 2018
Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

this requires a CI and CITGM run.

@BridgeAR
Copy link
Member

BridgeAR commented Feb 1, 2018

@BridgeAR BridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 1, 2018
@mcollina
Copy link
Member

mcollina commented Feb 1, 2018

@BridgeAR I was from mobile :(.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina
Copy link
Member

mcollina commented Feb 2, 2018

Landed as f0b2dd3.

@mcollina mcollina closed this Feb 2, 2018
mcollina pushed a commit that referenced this pull request Feb 2, 2018
In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null.  So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.

PR-URL: #18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@addaleax addaleax removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 4, 2018
MylesBorins pushed a commit that referenced this pull request Feb 20, 2018
In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null.  So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.

PR-URL: #18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null.  So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.

PR-URL: #18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Feb 21, 2018
In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null.  So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.

PR-URL: #18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Feb 21, 2018
@MylesBorins
Copy link
Contributor

MylesBorins commented Mar 20, 2018

@MoonBall does this apply to 6.x or 8.x?

MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
In implementation of `stream.Writable`, `writable._write()` is
always called with a callback that is `_writableState.onwrite()`.
And In `afterTransform()`, `ts.writechunk` and `ts.writecb` are
assigned to null.  So, `ts.writecb` is a true value if
`ts.writechunk` isn't null.

PR-URL: nodejs#18278
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stream Issues and PRs related to the stream subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants