Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize character escaping. #2833

Merged
merged 2 commits into from
Jun 5, 2024
Merged

Conversation

TDecking
Copy link
Contributor

@TDecking TDecking commented Jun 5, 2024

Rewrites the char_to_escaped_literal and bytes_to_escaped_literal functions in a way that minimizes heap allocations.
After this, the resulting string is the only allocation remaining.

Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

Thanks!

@BurntSushi BurntSushi merged commit c9ebcbd into BurntSushi:master Jun 5, 2024
18 checks passed
@TDecking TDecking deleted the optimize-escape branch June 5, 2024 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants