Skip to content

Commit

Permalink
fs: remove extraneous assignments in rmdir()
Browse files Browse the repository at this point in the history
validateRmOptions() doesn't return a value, so this commit
removes the assignment. The options passed to
validateRmdirOptions() are not used again after validation, so
this commit removes the assignment.

PR-URL: #35567
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
  • Loading branch information
cjihrig authored and MylesBorins committed Oct 14, 2020
1 parent 1fadcf2 commit 1ad9aca
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -859,20 +859,16 @@ function rmdir(path, options, callback) {
path = pathModule.toNamespacedPath(getValidatedPath(path));

if (options && options.recursive) {
options = validateRmOptions(
path,
{ ...options, force: true },
(err, options) => {
if (err) {
return callback(err);
}

lazyLoadRimraf();
return rimraf(path, options, callback);
});
validateRmOptions(path, { ...options, force: true }, (err, options) => {
if (err) {
return callback(err);
}

lazyLoadRimraf();
return rimraf(path, options, callback);
});
} else {
options = validateRmdirOptions(options);
validateRmdirOptions(options);
const req = new FSReqCallback();
req.oncomplete = callback;
return binding.rmdir(path, req);
Expand Down

0 comments on commit 1ad9aca

Please sign in to comment.