Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class SendMessageController {
}

let byteLength = 0;
const textEncoder = new TextEncoder();
// One loop to calculate the length in bytes of all of the provided data
messageData.forEach((element: number | string, idx: number) => {
const type = messageFormat.structure[idx];
Expand Down Expand Up @@ -90,8 +89,8 @@ export class SendMessageController {
case 'string':
// 2 bytes for string length
byteLength += 2;
// 2 bytes per characters
byteLength += 2 * textEncoder.encode(element as string).length;
// 2 bytes per character
byteLength += 2 * (element as string).length;
break;
}
});
Expand Down