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>
This commit is contained in:
parent
4d090855c6
commit
42e55eb37b
11
lib/net.js
11
lib/net.js
@ -1524,9 +1524,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);
|
||||||
});
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1562,9 +1562,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…
x
Reference in New Issue
Block a user