Skip to content

Commit

Permalink
calling both lstat and stat isnt needed in doScan
Browse files Browse the repository at this point in the history
  • Loading branch information
ArjhanToteck committed Mar 11, 2024
1 parent 5b22101 commit c54fa9f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions lib/DirectoryWatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,6 @@ class DirectoryWatcher extends EventEmitter {
true,
"scan (file)"
);
if (
this.watcherManager.options.followSymlinks &&
stats.isSymbolicLink()
) {
fs.stat(itemPath, handleStats);
}
} else if (stats.isDirectory()) {
if (!initial || !this.directories.has(itemPath))
this.setDirectory(
Expand All @@ -670,7 +664,11 @@ class DirectoryWatcher extends EventEmitter {
}
itemFinished();
};
fs.lstat(itemPath, handleStats);
if (this.watcherManager.options.followSymlinks) {
fs.stat(itemPath, handleStats);
} else {
fs.lstat(itemPath, handleStats);
}
}
itemFinished();
});
Expand Down

0 comments on commit c54fa9f

Please sign in to comment.