Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fs: remove extraneous assignments in rmdir()
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 <technicalcute@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
  • 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
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.