mirror of https://github.com/godotengine/godot
Web: Avoid extra copy when encoding string in WebSocket _onmessage
This commit is contained in:
parent
2d3bdcac35
commit
f05b22c53e
|
|
@ -58,8 +58,7 @@ const GodotWebSocket = {
|
|||
return;
|
||||
} else if (typeof event.data === 'string') {
|
||||
is_string = 1;
|
||||
const enc = new TextEncoder('utf-8');
|
||||
buffer = new Uint8Array(enc.encode(event.data));
|
||||
buffer = new TextEncoder('utf-8').encode(event.data);
|
||||
} else {
|
||||
GodotRuntime.error('Unknown message type');
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in New Issue