Skip to content

Commit

Permalink
Fix drain() function
Browse files Browse the repository at this point in the history
`fill()` makes copies of the argument which is not what we want.
  • Loading branch information
OlliV committed Aug 9, 2017
1 parent 0a4984d commit e03d53f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ class Sema {

drain () {
const a = new Array(this.nrTokens)
a.fill(this.v())
for (let i = 0; i < this.nrTokens; i++) {
a[i] = this.v()
}
return Promise.all(a)
}

Expand Down

0 comments on commit e03d53f

Please sign in to comment.