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

Improve UTF-8 encoding by rearranging sufficient space check #1222

Closed

Conversation

cowtowncoder
Copy link
Member

(contributed by @xtonik)

...also arguably slightly improves readability of code.

@cowtowncoder
Copy link
Member Author

Oh. No, this fails unit tests and that's because it's not functionally equivalent -- _allocMore() does NOT resize current block; the underlying buffers are segmented.
So allocation must fully align with byte boundary, otherwise there'll be one or more "empty" slots in the last buffer.

So, cannot do this optimization.

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.

None yet

2 participants