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

unicoder.cpp light performance improvements #1586

Merged
merged 4 commits into from
Nov 25, 2022
Merged

Conversation

hordi
Copy link
Contributor

@hordi hordi commented Nov 24, 2022

No description provided.

CheckForInvalidUtf8 performance improvement
light performance improvements
space-tab change
if (uc >= 0xd800 && uc < 0xdc00)
{
++it;
if (it != tstr.end())
if (++i != len)

Check notice

Code scanning / CodeQL

For loop variable changed in body

Loop counters should not be modified in the body of the [loop](1).
@sdottaka sdottaka merged commit ed40b4f into WinMerge:master Nov 25, 2022
@sdottaka
Copy link
Member

Thank you!

@sdottaka sdottaka added this to the v2.16.25 milestone Nov 25, 2022
@@ -792,10 +789,10 @@ void buffer::resize(size_t newSize)
{
if (capacity < newSize)
{
capacity = newSize;
unsigned char *tmp = static_cast<unsigned char *>(realloc(ptr, capacity));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm sorry if my understanding is wrong, but I think this process needs to be modified as follows.

unsigned char *tmp = static_cast<unsigned char *>(realloc(ptr, newSize));

Copy link
Member

Choose a reason for hiding this comment

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

good catch. thank you!

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.

3 participants