Browse Source

net: avoid using forEach

PR-URL: https://github.com/nodejs/node/pull/11582
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
v7.x
James M Snell 8 years ago
committed by Italo A. Casas
parent
commit
c0a2e02f51
No known key found for this signature in database GPG Key ID: 23EFEFE93C4CFFFE
  1. 11
      lib/net.js

11
lib/net.js

@ -1502,9 +1502,9 @@ Server.prototype.getConnections = function(cb) {
if (--left === 0) return end(null, total); if (--left === 0) return end(null, total);
} }
this._slaves.forEach(function(slave) { for (var n = 0; n < this._slaves.length; n++) {
slave.getConnections(oncount); this._slaves[n].getConnections(oncount);
}); }
}; };
@ -1540,9 +1540,8 @@ Server.prototype.close = function(cb) {
this._connections++; this._connections++;
// Poll slaves // Poll slaves
this._slaves.forEach(function(slave) { for (var n = 0; n < this._slaves.length; n++)
slave.close(onSlaveClose); this._slaves[n].close(onSlaveClose);
});
} else { } else {
this._emitCloseIfDrained(); this._emitCloseIfDrained();
} }

Loading…
Cancel
Save