[Pkg-javascript-commits] [node-module-deps] 397/444: only create fileCache stream if it'll be used

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:48:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-module-deps.

commit e9c4a612ae6db199b3aaa7b265e1c653d66b725c
Author: Andres Suarez <zertosh at gmail.com>
Date:   Mon Aug 24 03:08:41 2015 -0400

    only create fileCache stream if it'll be used
---
 index.js | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/index.js b/index.js
index 179a967..923b0b5 100644
--- a/index.js
+++ b/index.js
@@ -181,11 +181,9 @@ Deps.prototype.resolve = function (id, parent, cb) {
 
 Deps.prototype.readFile = function (file, id, pkg) {
     var self = this;
-    var tr = through();
-
-    var inputSource = this.fileCache && this.fileCache[file];
-    if (inputSource) {
-        tr.push(inputSource);
+    if (xhas(this.fileCache, file)) {
+        var tr = through();
+        tr.push(this.fileCache[file]);
         tr.push(null);
         return tr;
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git



More information about the Pkg-javascript-commits mailing list