summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYash Ladha <yashladhapankajladha123@gmail.com>2020-04-21 12:55:58 +0530
committerRuben Bridgewater <ruben@bridgewater.de>2020-04-28 13:58:28 +0200
commit0f4d513873ecfdec4834398cdbe5493696814d39 (patch)
tree1f8d0e25e764f8f984ca3f00275ca52e97067288
parent14cf9043e57efc430699576e483a4f1772335f5a (diff)
downloadnode-new-0f4d513873ecfdec4834398cdbe5493696814d39.tar.gz
cluster: removed unused addressType argument from constructor
When intializing the constructor for cluster master we are heavily using a generic structure, but the effect of passing arguments that are related to shared_handle is that there is a stale argument passed. We can avoid such scenarios as all the remaining entities are being destructured from the message object. PR-URL: https://github.com/nodejs/node/pull/32963 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Andrey Pechkurov <apechkurov@gmail.com>
-rw-r--r--lib/internal/cluster/master.js7
-rw-r--r--lib/internal/cluster/round_robin_handle.js2
-rw-r--r--lib/internal/cluster/shared_handle.js2
3 files changed, 3 insertions, 8 deletions
diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js
index dc8efc1f98..9d6d4df631 100644
--- a/lib/internal/cluster/master.js
+++ b/lib/internal/cluster/master.js
@@ -297,12 +297,7 @@ function queryServer(worker, message) {
constructor = SharedHandle;
}
- handle = new constructor(key,
- address,
- message.port,
- message.addressType,
- message.fd,
- message.flags);
+ handle = new constructor(key, address, message);
handles.set(key, handle);
}
diff --git a/lib/internal/cluster/round_robin_handle.js b/lib/internal/cluster/round_robin_handle.js
index 213b72c19f..492fd725c8 100644
--- a/lib/internal/cluster/round_robin_handle.js
+++ b/lib/internal/cluster/round_robin_handle.js
@@ -13,7 +13,7 @@ const { constants } = internalBinding('tcp_wrap');
module.exports = RoundRobinHandle;
-function RoundRobinHandle(key, address, port, addressType, fd, flags) {
+function RoundRobinHandle(key, address, { port, fd, flags }) {
this.key = key;
this.all = new Map();
this.free = new Map();
diff --git a/lib/internal/cluster/shared_handle.js b/lib/internal/cluster/shared_handle.js
index 20c028ce31..656b129298 100644
--- a/lib/internal/cluster/shared_handle.js
+++ b/lib/internal/cluster/shared_handle.js
@@ -6,7 +6,7 @@ const net = require('net');
module.exports = SharedHandle;
-function SharedHandle(key, address, port, addressType, fd, flags) {
+function SharedHandle(key, address, { port, addressType, fd, flags }) {
this.key = key;
this.workers = new Map();
this.handle = null;