Skip to content

Commit

Permalink
Move simpleAttributes const inside only place it’s used
Browse files Browse the repository at this point in the history
And define it more simply.
  • Loading branch information
lawrence-forooghian committed Nov 22, 2023
1 parent d750acd commit 0d2d3f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/common/lib/types/protocolmessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ function toStringArray(array?: any[]): string {
return '[ ' + result.join(', ') + ' ]';
}

const simpleAttributes = 'id channel channelSerial connectionId count msgSerial timestamp'.split(' ');

class ProtocolMessage {
action?: number;
flags?: number;
Expand Down Expand Up @@ -133,6 +131,7 @@ class ProtocolMessage {
let result = '[ProtocolMessage';
if (msg.action !== undefined) result += '; action=' + ProtocolMessage.ActionName[msg.action] || msg.action;

const simpleAttributes = ['id', 'channel', 'channelSerial', 'connectionId', 'count', 'msgSerial', 'timestamp'];
let attribute;
for (let attribIndex = 0; attribIndex < simpleAttributes.length; attribIndex++) {
attribute = simpleAttributes[attribIndex];
Expand Down

0 comments on commit 0d2d3f4

Please sign in to comment.