You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Web: Avoid extra copy when encoding string in WebSocket _onmessage
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user