From e51da915103a0cfdd827e9e425c1998bd0439c5e Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Tue, 4 Mar 2014 11:15:41 -0800 Subject: [PATCH] fix weird conditional --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ed71849..3bfd728 100644 --- a/index.js +++ b/index.js @@ -11,10 +11,9 @@ module.exports = function *parallel(thunks, n){ var index = 0; function *next() { - var i = index; - index++; + var i = index++; ret[i] = yield thunks[i]; - index < thunks.length && (yield next); + if (index < thunks.length) yield next; } yield thread(next, n);