Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1269 from atom/wl-rm-realpath-cache
Browse files Browse the repository at this point in the history
Remove realpathCache argument in fs.realpath
  • Loading branch information
Winston Liu authored Jul 6, 2018
2 parents aab456b + f4be1fc commit 208d0bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/directory.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const fs = require('fs-plus')
const PathWatcher = require('pathwatcher')
const File = require('./file')
const {repoForPath} = require('./helpers')
const realpathCache = {}

module.exports =
class Directory {
Expand Down Expand Up @@ -116,7 +115,7 @@ class Directory {
this.lowerCaseRealPath = this.realPath.toLowerCase()
}
} else {
fs.realpath(this.path, realpathCache, (error, realPath) => {
fs.realpath(this.path, (error, realPath) => {
// FIXME: Add actual error handling
if (error || this.destroyed) return
if (realPath && (realPath !== this.path)) {
Expand Down Expand Up @@ -320,7 +319,7 @@ class Directory {
// track the insertion index for the created views
files.push(name)
} else {
files.push(new File({name, fullPath, symlink, realpathCache, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat}))
files.push(new File({name, fullPath, symlink, ignoredNames: this.ignoredNames, useSyncFS: this.useSyncFS, stats: statFlat}))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {repoForPath} = require('./helpers')

module.exports =
class File {
constructor ({name, fullPath, symlink, realpathCache, ignoredNames, useSyncFS, stats}) {
constructor ({name, fullPath, symlink, ignoredNames, useSyncFS, stats}) {
this.name = name
this.symlink = symlink
this.ignoredNames = ignoredNames
Expand All @@ -22,7 +22,7 @@ class File {
if (useSyncFS) {
this.realPath = fs.realpathSync(this.path)
} else {
fs.realpath(this.path, realpathCache, (error, realPath) => {
fs.realpath(this.path, (error, realPath) => {
// FIXME: Add actual error handling
if (error || this.destroyed) return
if (realPath && realPath !== this.path) {
Expand Down

0 comments on commit 208d0bb

Please sign in to comment.