Skip to content

Commit 1ad9aca

Browse files
cjihrigMylesBorins
authored andcommitted
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 <[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]>
1 parent 1fadcf2 commit 1ad9aca

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

lib/fs.js

+8-12
Original file line numberDiff line numberDiff line change
@@ -859,20 +859,16 @@ function rmdir(path, options, callback) {
859859
path = pathModule.toNamespacedPath(getValidatedPath(path));
860860

861861
if (options && options.recursive) {
862-
options = validateRmOptions(
863-
path,
864-
{ ...options, force: true },
865-
(err, options) => {
866-
if (err) {
867-
return callback(err);
868-
}
869-
870-
lazyLoadRimraf();
871-
return rimraf(path, options, callback);
872-
});
862+
validateRmOptions(path, { ...options, force: true }, (err, options) => {
863+
if (err) {
864+
return callback(err);
865+
}
873866

867+
lazyLoadRimraf();
868+
return rimraf(path, options, callback);
869+
});
874870
} else {
875-
options = validateRmdirOptions(options);
871+
validateRmdirOptions(options);
876872
const req = new FSReqCallback();
877873
req.oncomplete = callback;
878874
return binding.rmdir(path, req);

0 commit comments

Comments
 (0)