cluster: refactor empty for in round_robin_handle.js

PR-URL: https://github.com/nodejs/node/pull/26560
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
gengjiawen authored and Beth Griggs committed 2019-04-17 00:15:11 +01:00
1 parent 8855395a19
commit 4b3e9486ca
1 file changed
+4 -2
+4 -2
View File
@@ -73,8 +73,10 @@ RoundRobinHandle.prototype.remove = function(worker) {
if (this.all.size !== 0)
return false;
for (var handle; handle = this.handles.shift(); handle.close())
;
for (const handle of this.handles) {
handle.close();
}
this.handles = [];
this.handle.close();
this.handle = null;