-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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: replace duplicate conditions by a function #18717
Conversation
lib/fs.js
Outdated
@@ -346,6 +346,12 @@ Stats.prototype.isSocket = function() { | |||
|
|||
const statValues = binding.statValues; | |||
|
|||
function isPathPart(fileType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isPathPart()
might not be the best name. Maybe isFileType()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cjihrig yeah, It sounds much better! Thank you!
4161e1a
to
ce713fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but we should run the benchmark. It shouldn't have any significant changes but fs is particularly sensitive.
@jasnell Hi! Looks like there are no significant changes
P.S.
I'll try to repeat it |
100 runs:
Looks like there is small performance improvement |
@daynin this needs a rebase. |
ce713fb
to
79dc5d3
Compare
@BridgeAR done |
Light-CI for the rebase https://ci.nodejs.org/job/node-test-commit-light/291/ |
79dc5d3
to
4927054
Compare
@BridgeAR the conflict was resolved |
cc @nodejs/collaborators Hello! Run CI for this PR, please |
Landed in 523d44a |
PR-URL: #18717 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Should this be backported to |
PR-URL: nodejs#18717 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
PR-URL: nodejs#18717 Reviewed-By: Weijia Wang <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Yuta Hiroto <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Should this be backported to 8.x? If so, a backport PR will be needed |
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
fs