We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c4df4f2 commit 206ea89Copy full SHA for 206ea89
Frontend/library/src/UeInstanceMessage/SendMessageController.ts
@@ -62,7 +62,6 @@ export class SendMessageController {
62
}
63
64
let byteLength = 0;
65
- const textEncoder = new TextEncoder();
66
// One loop to calculate the length in bytes of all of the provided data
67
messageData.forEach((element: number | string, idx: number) => {
68
const type = messageFormat.structure[idx];
@@ -90,8 +89,8 @@ export class SendMessageController {
90
89
case 'string':
91
// 2 bytes for string length
92
byteLength += 2;
93
- // 2 bytes per characters
94
- byteLength += 2 * textEncoder.encode(element as string).length;
+ // 2 bytes per character
+ byteLength += 2 * (element as string).length;
95
break;
96
97
});
0 commit comments