Skip to content

Commit

Permalink
code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
icebob committed Nov 25, 2023
1 parent f9e538b commit 4f4f6d7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/transporters/tcp.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class TcpTransporter extends Transporter {
if (endpoints.length === 0) return;

const ep =
endpoints.length == 1
endpoints.length === 1
? endpoints[0]
: endpoints[Math.floor(Math.random() * endpoints.length)];
if (ep) {
Expand Down Expand Up @@ -641,9 +641,9 @@ class TcpTransporter extends Transporter {

let info, cpu, cpuSeq;

if (row.length == 1) info = row[0];
else if (row.length == 2) [cpuSeq, cpu] = row;
else if (row.length == 3) [info, cpuSeq, cpu] = row;
if (row.length === 1) info = row[0];
else if (row.length === 2) [cpuSeq, cpu] = row;
else if (row.length === 3) [info, cpuSeq, cpu] = row;

let node = this.nodes.get(nodeID);
if (info && (!node || node.seq < info.seq)) {
Expand Down
2 changes: 1 addition & 1 deletion src/transporters/tcp/udp-broadcaster.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class UdpServer extends EventEmitter {

try {
const parts = msg.split("|");
if (parts.length != 3) {
if (parts.length !== 3) {
this.logger.debug("Malformed UDP packet received", msg);
return;
}
Expand Down

0 comments on commit 4f4f6d7

Please sign in to comment.