Skip to content

Commit

Permalink
don't push twice for the same message to avoid race conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ZabelTech committed Aug 20, 2024
1 parent 6d564a7 commit 4049258
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,7 @@ class Wire extends Duplex {
view.setUint32(5 + (4 * i), numbers[i])
}

this._push(buffer)
if (data) this._push(data)
this._push(concat([buffer,data ?? []]))
}

_push (data) {
Expand Down

0 comments on commit 4049258

Please sign in to comment.