Allow v8 to optimize fs.readFileSync
This commit is contained in:
parent
21a7c459d8
commit
9c69877421
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
Reference in a new issue