stream: remove always-false condition check#41488
Merged
nodejs-github-bot merged 1 commit intonodejs:masterfrom Jan 15, 2022
Merged
stream: remove always-false condition check#41488nodejs-github-bot merged 1 commit intonodejs:masterfrom
nodejs-github-bot merged 1 commit intonodejs:masterfrom
Conversation
Remove comparison to null of variable guaranteed to be a boolean.
Collaborator
|
Review requested:
|
Collaborator
benjamingr
approved these changes
Jan 12, 2022
ronag
approved these changes
Jan 12, 2022
tniessen
approved these changes
Jan 12, 2022
aduh95
reviewed
Jan 12, 2022
| @@ -119,14 +119,14 @@ function isReadableFinished(stream, strict) { | |||
| function isReadable(stream) { | |||
| if (stream && stream[kIsReadable] != null) return stream[kIsReadable]; | |||
| const r = isReadableNodeStream(stream); | |||
Contributor
There was a problem hiding this comment.
r value is unused if typeof stream?.readable is not a boolean, it would be worth move its assignment below. (Same in isWritable)
This comment has been minimized.
This comment has been minimized.
RaisinTen
approved these changes
Jan 14, 2022
Collaborator
|
Landed in f7be6ab |
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Jan 15, 2022
Instead of assigning a boolean, move the function call that assigns a value to the boolean to the only place that boolean is checked. This avoids the function call in cases where it is not needed. Refs: nodejs#41488 (review)
targos
pushed a commit
that referenced
this pull request
Jan 16, 2022
Remove comparison to null of variable guaranteed to be a boolean. PR-URL: #41488 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
mawaregetsuka
pushed a commit
to mawaregetsuka/node
that referenced
this pull request
Jan 17, 2022
Remove comparison to null of variable guaranteed to be a boolean. PR-URL: nodejs#41488 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
nodejs-github-bot
pushed a commit
that referenced
this pull request
Jan 17, 2022
Instead of assigning a boolean, move the function call that assigns a value to the boolean to the only place that boolean is checked. This avoids the function call in cases where it is not needed. Refs: #41488 (review) PR-URL: #41534 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
thedull
pushed a commit
to thedull/node
that referenced
this pull request
Jan 18, 2022
Remove comparison to null of variable guaranteed to be a boolean. PR-URL: nodejs#41488 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
thedull
pushed a commit
to thedull/node
that referenced
this pull request
Jan 18, 2022
Instead of assigning a boolean, move the function call that assigns a value to the boolean to the only place that boolean is checked. This avoids the function call in cases where it is not needed. Refs: nodejs#41488 (review) PR-URL: nodejs#41534 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
BethGriggs
pushed a commit
that referenced
this pull request
Jan 25, 2022
Instead of assigning a boolean, move the function call that assigns a value to the boolean to the only place that boolean is checked. This avoids the function call in cases where it is not needed. Refs: #41488 (review) PR-URL: #41534 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Linkgoron
pushed a commit
to Linkgoron/node
that referenced
this pull request
Jan 31, 2022
Remove comparison to null of variable guaranteed to be a boolean. PR-URL: nodejs#41488 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Linkgoron
pushed a commit
to Linkgoron/node
that referenced
this pull request
Jan 31, 2022
Instead of assigning a boolean, move the function call that assigns a value to the boolean to the only place that boolean is checked. This avoids the function call in cases where it is not needed. Refs: nodejs#41488 (review) PR-URL: nodejs#41534 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
danielleadams
pushed a commit
that referenced
this pull request
Feb 1, 2022
Remove comparison to null of variable guaranteed to be a boolean. PR-URL: #41488 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Merged
danielleadams
pushed a commit
that referenced
this pull request
Feb 26, 2022
Instead of assigning a boolean, move the function call that assigns a value to the boolean to the only place that boolean is checked. This avoids the function call in cases where it is not needed. Refs: #41488 (review) PR-URL: #41534 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove comparison to null of variable guaranteed to be a boolean.