[Pkg-javascript-commits] [node-stream-splicer] 17/71: use splice to initially populate the list

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


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

rouca pushed a commit to branch master
in repository node-stream-splicer.

commit 945e844eeeaa9972c2293ec8df0e34d13cc8cac3
Author: James Halliday <mail at substack.net>
Date:   Sun Jun 8 14:16:10 2014 -0700

    use splice to initially populate the list
---
 index.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/index.js b/index.js
index 2b65a94..41f8c99 100644
--- a/index.js
+++ b/index.js
@@ -33,9 +33,7 @@ function Pipeline (streams, opts) {
     this._wrapOptions = { objectMode: opts.objectMode !== false };
     this._streams = [];
     
-    for (var i = 0; i < streams.length; i++) {
-        this.push(streams[i]);
-    }
+    this.splice.apply(this, [ 0, 0 ].concat(streams));
     
     this.once('finish', function () {
         self._streams[0].end();

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



More information about the Pkg-javascript-commits mailing list