amqplib 0.5.5 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/mux.js CHANGED
@@ -55,26 +55,11 @@ Mux.prototype._readIncoming = function() {
55
55
  // are empty, or we exhaust our ability to accept chunks.
56
56
  function roundrobin(streams) {
57
57
  var s;
58
- // if there's just one incoming stream we don't have to
59
- // go through all the dequeue/enqueueing
60
- if (streams.length === 1) {
61
- s = streams.shift();
62
- while (accepting) {
63
- var chunk = s.read();
64
- if (chunk !== null) {
65
- accepting = out.write(chunk);
66
- }
67
- else break;
68
- }
69
- if (!accepting) streams.push(s);
70
- }
71
- else {
72
- while (accepting && (s = streams.shift())) {
73
- var chunk = s.read();
74
- if (chunk !== null) {
75
- accepting = out.write(chunk);
76
- streams.push(s);
77
- }
58
+ while (accepting && (s = streams.shift())) {
59
+ var chunk = s.read();
60
+ if (chunk !== null) {
61
+ accepting = out.write(chunk);
62
+ streams.push(s);
78
63
  }
79
64
  }
80
65
  }
@@ -105,7 +90,7 @@ Mux.prototype._readIncoming = function() {
105
90
 
106
91
  Mux.prototype._scheduleRead = function() {
107
92
  var self = this;
108
-
93
+
109
94
  if (!self.scheduledRead) {
110
95
  schedule(function() {
111
96
  self.scheduledRead = false;