Merge pull request #3275 from atom/as-optimize-fs-read-file-sync
Allow v8 to optimize fs.readFileSync
This commit is contained in:
commit
d223faa9f4
1 changed files with 2 additions and 1 deletions
|
@ -254,7 +254,8 @@ exports.wrapFsWithAsar = (fs) ->
|
||||||
|
|
||||||
openSync = fs.openSync
|
openSync = fs.openSync
|
||||||
readFileSync = fs.readFileSync
|
readFileSync = fs.readFileSync
|
||||||
fs.readFileSync = (p, options) ->
|
fs.readFileSync = (p, opts) ->
|
||||||
|
options = opts # this allows v8 to optimize this function
|
||||||
[isAsar, asarPath, filePath] = splitPath p
|
[isAsar, asarPath, filePath] = splitPath p
|
||||||
return readFileSync.apply this, arguments unless isAsar
|
return readFileSync.apply this, arguments unless isAsar
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue