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

fs: use isUint32 in isFd #20330

Closed
wants to merge 2 commits into from
Closed

Conversation

danbev
Copy link
Contributor

@danbev danbev commented Apr 26, 2018

This commit updates the isFd function to call isUint32 instead of
doing the same thing. I was tempted to remove isFd and just use isUint32
instead but wanted to get some feedback from others regarding
readablity.

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

This commit updates the isFd function to call isUint32 instead of
doing the same thing. I was tempted to remove isFd and just use isUint32
instead but wanted to get some feedback from others regarding
readablity.
@nodejs-github-bot nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Apr 26, 2018
@danbev
Copy link
Contributor Author

danbev commented Apr 26, 2018

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.

Should we not replace isFd with isUint32 in this case?

@danbev
Copy link
Contributor Author

danbev commented Apr 26, 2018

Should we not replace isFd with isUint32 in this case?

Yeah, I was thinking the same thing (mentioned in the commit message). I'd prefer that. I'll wait a little and if no one objects I'll update.

@tniessen
Copy link
Member

If you'd like to still call isFd, you could use const isFd = isUint32 to avoid the function declaration.

@danbev
Copy link
Contributor Author

danbev commented Apr 26, 2018

If you'd like to still call isFd, you could use const isFd = isUint32 to avoid the function declaration.

I'd like to just use isUint32, but I like what you suggested there if others disagree. Thanks!

@benjamingr
Copy link
Member

I'm +1 on what @tniessen suggested - they do the same thing - but I like the fact isFd is explicit about what it does.

Copy link
Member

@benjamingr benjamingr left a comment

Choose a reason for hiding this comment

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

And in either case LGTM on the current code.

Copy link
Member

@tniessen tniessen left a comment

Choose a reason for hiding this comment

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

LGTM either way.

Copy link
Member

@TimothyGu TimothyGu left a comment

Choose a reason for hiding this comment

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

I’m not a fan of exposing internal functions to userland. The PR in its current shape LGTM.

@BridgeAR
Copy link
Member

@TimothyGu that function is only used internally as far as I can tell.

@TimothyGu
Copy link
Member

Ah oops. In that case LGTM either way.

Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

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

I prefer to keep isFd as it more clearly indicates the intent (as opposed to implementation).

@danbev
Copy link
Contributor Author

danbev commented Apr 27, 2018

@BridgeAR BridgeAR added fast-track PRs that do not need to wait for 48 hours to land. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 27, 2018
@BridgeAR
Copy link
Member

Landed in bdf0d9b 🎉

@BridgeAR BridgeAR closed this Apr 28, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Apr 28, 2018
This commit updates the isFd function to call isUint32 instead of
doing the same thing.

PR-URL: nodejs#20330
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@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 May 4, 2018
This commit updates the isFd function to call isUint32 instead of
doing the same thing.

PR-URL: #20330
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request May 8, 2018
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. fast-track PRs that do not need to wait for 48 hours to land. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants