Skip to content

Commit

Permalink
fs: cache non-symlinks in realpathSync.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
yallop authored and evanlucas committed Jan 4, 2017
1 parent 10b3297 commit 6629f8f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ fs.realpathSync = function realpathSync(p, options) {
var stat = fs.lstatSync(base);
if (!stat.isSymbolicLink()) {
knownHard[base] = true;
if (cache) cache.set(base, base);
continue;
}

Expand Down

0 comments on commit 6629f8f

Please sign in to comment.