eclipse / paho.mqtt.javascript

paho.mqtt.javascript
Other
1.14k stars 468 forks source link

Remove the need for reversing arrays for processing #122

Closed tmulkern closed 6 years ago

tmulkern commented 6 years ago

Changed usages of push on this._buffered_msg_queue and this._msg_queue to use unshift

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/unshift, removing the need to reverse the array to pop elements in fifo order

Signed-off-by: Tadhg Mulkerntadhg.j.mulkern@gmail.com

tmulkern commented 6 years ago

@jpwsutton Is this ok to merge?

jpwsutton commented 6 years ago

Thanks for the PR @tmulkern, sorry it took a while to merge in! Nice spot!