Skip to content

Commit 4a872b9

Browse files
BridgeARMylesBorins
authored andcommitted
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: #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]>
1 parent 3aab6ce commit 4a872b9

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/internal/cluster/master.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,8 @@ function queryServer(worker, message) {
275275
if (worker.exitedAfterDisconnect)
276276
return;
277277

278-
const args = [message.address,
279-
message.port,
280-
message.addressType,
281-
message.fd,
282-
message.index];
283-
const key = args.join(':');
278+
const key = `${message.address}:${message.port}:${message.addressType}:` +
279+
`${message.fd}:${message.index}`;
284280
var handle = handles[key];
285281

286282
if (handle === undefined) {

0 commit comments

Comments
 (0)