Skip to content

Commit fa80ba6

Browse files
committed
calling both lstat and stat isnt needed in doScan
1 parent 5b22101 commit fa80ba6

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/DirectoryWatcher.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -653,12 +653,6 @@ class DirectoryWatcher extends EventEmitter {
653653
true,
654654
"scan (file)"
655655
);
656-
if (
657-
this.watcherManager.options.followSymlinks &&
658-
stats.isSymbolicLink()
659-
) {
660-
fs.stat(itemPath, handleStats);
661-
}
662656
} else if (stats.isDirectory()) {
663657
if (!initial || !this.directories.has(itemPath))
664658
this.setDirectory(
@@ -670,7 +664,11 @@ class DirectoryWatcher extends EventEmitter {
670664
}
671665
itemFinished();
672666
};
673-
fs.lstat(itemPath, handleStats);
667+
if (this.watcherManager.options.followSymlinks) {
668+
fs.stat(itemPath, handleStats);
669+
} else {
670+
fs.lstat(itemPath, handleStats);
671+
}
674672
}
675673
itemFinished();
676674
});

0 commit comments

Comments
 (0)