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

readline: remove intermediate variable #31676

Merged
merged 1 commit into from
Feb 9, 2020
Merged

Conversation

cjihrig
Copy link
Contributor

@cjihrig cjihrig commented Feb 7, 2020

This commit removes an extra intermediate variable. This makes the call consistent with other uses of validateUint32() in the codebase.

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

@nodejs-github-bot nodejs-github-bot added the readline Issues and PRs related to the built-in readline module. label Feb 7, 2020
Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

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

I added the variable deliberately to indicate the meaning of it. It's otherwise not possible to know what true stands for. Instead of removing the variable, it's likely better to change other places to also indicate the passed through meaning.

@lpinca
Copy link
Member

lpinca commented Feb 7, 2020

It's otherwise not possible to know what true stands for

The reader needs to jump to validateUint32() definition, but it's there no?

@BridgeAR
Copy link
Member

BridgeAR commented Feb 9, 2020

@lpinca it's an indirection and IMO true and false are similar to magic numbers: ideally they are not used.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Feb 9, 2020

@cjihrig cjihrig added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 9, 2020
This commit removes an extrea intermediate variable. This
makes the call consistent with other uses of validateUint32()
in the codebase.

PR-URL: nodejs#31676
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@cjihrig cjihrig merged commit efec681 into nodejs:master Feb 9, 2020
@cjihrig cjihrig deleted the positive branch February 9, 2020 16:07
@cjihrig
Copy link
Contributor Author

cjihrig commented Feb 9, 2020

It's not really feasible to replace all uses of true and false throughout the codebase, and there is nothing special about validateUint32() (in fact it's an internal API), so I've gone ahead and landed this.

codebytere pushed a commit that referenced this pull request Feb 17, 2020
This commit removes an extrea intermediate variable. This
makes the call consistent with other uses of validateUint32()
in the codebase.

PR-URL: #31676
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@codebytere codebytere mentioned this pull request Feb 17, 2020
@targos
Copy link
Member

targos commented Apr 18, 2020

depends on #31318 to land on v12.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. readline Issues and PRs related to the built-in readline module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants