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 <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 committed Oct 11, 2020
1 parent 94b0908 commit 91e0d9b
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 91e0d9b

Please sign in to comment.