Skip to content

Commit

Permalink
cluster: refactor empty for in round_robin_handle.js
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
gengjiawen authored and BridgeAR committed Mar 14, 2019
1 parent 3b8c9cd commit de738a3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/internal/cluster/round_robin_handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,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;
Expand Down

0 comments on commit de738a3

Please sign in to comment.