Skip to content

Commit

Permalink
cluster: remove obsolete array allocation
Browse files Browse the repository at this point in the history
The array was only used to create a key. Instead of allocating that
first, just directly create the necessary string.

PR-URL: #20567
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
  • Loading branch information
BridgeAR authored and MylesBorins committed May 22, 2018
1 parent 3aab6ce commit 4a872b9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/internal/cluster/master.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4a872b9

Please sign in to comment.