diff options
author | gengjiawen <technicalcute@gmail.com> | 2019-03-10 07:44:12 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2019-03-13 09:11:08 +0300 |
commit | a4d4e9d72168cb5673f83ff691a4d659b3f68415 (patch) | |
tree | 7a1e5dd788f4b7785987b0b338bed1a56525c3de /lib/internal/cluster | |
parent | e6fa50e9537441513df46987bc51e9001bd57f37 (diff) |
cluster: refactor empty for in round_robin_handle.js
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib/internal/cluster')
-rw-r--r-- | lib/internal/cluster/round_robin_handle.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/internal/cluster/round_robin_handle.js b/lib/internal/cluster/round_robin_handle.js index 86c7bec7386..5a12a61d494 100644 --- a/lib/internal/cluster/round_robin_handle.js +++ b/lib/internal/cluster/round_robin_handle.js @@ -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; |