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

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/internal/cluster/round_robin_handle.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ RoundRobinHandle.prototype.remove = function(worker) {
7979
if (this.all.size !== 0)
8080
return false;
8181

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

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

0 commit comments

Comments
 (0)