Skip to content

Commit

Permalink
fix weird conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 4, 2014
1 parent 09e1886 commit e51da91
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -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);
Expand Down

0 comments on commit e51da91

Please sign in to comment.