Skip to content

Commit e9c4a61

Browse files
committed
only create fileCache stream if it'll be used
1 parent bb388ab commit e9c4a61

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,9 @@ Deps.prototype.resolve = function (id, parent, cb) {
181181

182182
Deps.prototype.readFile = function (file, id, pkg) {
183183
var self = this;
184-
var tr = through();
185-
186-
var inputSource = this.fileCache && this.fileCache[file];
187-
if (inputSource) {
188-
tr.push(inputSource);
184+
if (xhas(this.fileCache, file)) {
185+
var tr = through();
186+
tr.push(this.fileCache[file]);
189187
tr.push(null);
190188
return tr;
191189
}

0 commit comments

Comments
 (0)