Skip to content

Conversation

@marcosc90
Copy link
Contributor

@marcosc90 marcosc90 commented Apr 19, 2025

This PR avoids an extra copy when handling string messages in the WebSocket _onmessage handler.
TextEncoder.encode() already returns a Uint8Array

@marcosc90 marcosc90 requested a review from a team as a code owner April 19, 2025 15:50
@AThousandShips AThousandShips added this to the 4.x milestone Apr 19, 2025
@marcosc90 marcosc90 changed the title Web: Avoid extra copy when encoding string in WebSocket _onmessage [Web] Avoid extra copy when encoding string in WebSocket _onmessage Apr 21, 2025
Copy link
Collaborator

@Faless Faless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely spot 🥇 ! LGTM.

@akien-mga akien-mga modified the milestones: 4.x, 4.5 Jun 2, 2025
@Repiteo Repiteo merged commit 760b352 into godotengine:master Jun 2, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jun 2, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants