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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
gengjiawen authored and BethGriggs committed Apr 16, 2019
1 parent 8855395 commit 4b3e948
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 @@ -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;
Expand Down

0 comments on commit 4b3e948

Please sign in to comment.