Skip to content

Commit cba23ed

Browse files
gengjiawenBridgeAR
authored andcommitted
cluster: refactor empty for in round_robin_handle.js
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>
1 parent 9e82ee9 commit cba23ed

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎lib/internal/cluster/round_robin_handle.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ RoundRobinHandle.prototype.remove = function(worker) {
7979
if(this.all.size!==0)
8080
returnfalse;
8181

82-
for(varhandle;handle=this.handles.shift();handle.close())
83-
;
82+
for(consthandleofthis.handles){
83+
handle.close();
84+
}
85+
this.handles=[];
8486

8587
this.handle.close();
8688
this.handle=null;

0 commit comments

Comments
 (0)