Skip to content

Commit 4b3e948

Browse files
gengjiawenBethGriggs
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 8855395 commit 4b3e948

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: lib/internal/cluster/round_robin_handle.js

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

76-
for (var handle; handle = this.handles.shift(); handle.close())
77-
;
76+
for (const handle of this.handles) {
77+
handle.close();
78+
}
79+
this.handles = [];
7880

7981
this.handle.close();
8082
this.handle = null;

0 commit comments

Comments
 (0)