cluster: remove obsolete array allocation

The array was only used to create a key. Instead of allocating that
first, just directly create the necessary string.

PR-URL: https://github.com/nodejs/node/pull/20567
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
This commit is contained in:
Ruben Bridgewater 2018-05-07 00:04:19 +02:00
parent 6550013b73
commit b4be89ffc1
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762

View File

@ -275,12 +275,8 @@ function queryServer(worker, message) {
if (worker.exitedAfterDisconnect)
return;
const args = [message.address,
message.port,
message.addressType,
message.fd,
message.index];
const key = args.join(':');
const key = `${message.address}:${message.port}:${message.addressType}:` +
`${message.fd}:${message.index}`;
var handle = handles[key];
if (handle === undefined) {