FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fs: cache non-symlinks in realpathSync. · nodejs/node@094a960 · GitHub

/ node Public

Commit 094a960

Browse files
authored andcommitted
fs: cache non-symlinks in realpathSync.
Extend `fs.realpathSync` to cache the results for paths that are not symlinks in addition to caching symlink mappings. PR-URL: #10253 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent a582205 commit 094a960

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎lib/fs.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,6 +1531,7 @@ fs.realpathSync = function realpathSync(p, options) {
15311531
var stat = fs.lstatSync(base);
15321532
if (!stat.isSymbolicLink()) {
15331533
knownHard[base] = true;
1534+
if (cache) cache.set(base, base);
15341535
continue;
15351536
}
15361537

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL