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: refactor to remove redundant validation #36984

Conversation

RaisinTen
Copy link
Contributor

The function makeCallback already calls validateCallback, so the call
inside copyFile can be removed.

makeCallback is called here:

node/lib/fs.js

Line 2050 in 568b26a

callback = makeCallback(callback);

and makeCallback calls validateCallback here:

node/lib/fs.js

Line 182 in 568b26a

validateCallback(cb);

The function makeCallback already calls validateCallback, so the call
inside copyFile can be removed.
@nodejs-github-bot nodejs-github-bot added the fs Issues and PRs related to the fs subsystem / file system. label Jan 18, 2021
@RaisinTen
Copy link
Contributor Author

cc @nodejs/fs

@nodejs-github-bot
Copy link
Collaborator

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Jan 18, 2021
@jasnell
Copy link
Member

jasnell commented Jan 23, 2021

Landed in ae5e95f

@jasnell jasnell closed this Jan 23, 2021
jasnell pushed a commit that referenced this pull request Jan 23, 2021
The function makeCallback already calls validateCallback, so the call
inside copyFile can be removed.

PR-URL: #36984
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@RaisinTen RaisinTen deleted the fs/refactor-to-remove-redundant-validation branch January 23, 2021 13:44
targos pushed a commit that referenced this pull request Feb 2, 2021
The function makeCallback already calls validateCallback, so the call
inside copyFile can be removed.

PR-URL: #36984
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Reviewed-By: James M Snell <[email protected]>
@targos targos mentioned this pull request Feb 2, 2021
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. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants