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

Remove unneeded else's to make slightly faster code #32402

Closed
wants to merge 2 commits into from
Closed

Remove unneeded else's to make slightly faster code #32402

wants to merge 2 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Feb 16, 2020

The infinite loop in utf8.cpp is notoriously slow, so much so that it was mentioned in the comments. I did a couple of micro optimizations that somewhat alleviated this while also making the code more readable, simply by merging some if statements in which the resulting statement made more logical sense as well as removing else statements for statements after an if statement that would goto another code section anyway.

@jkotas
Copy link
Member

jkotas commented Feb 16, 2020

make slightly faster code

Do you have any data that shows the code is faster with this change?

As far as I can tell, this is just a cosmetic change. The code before/after will be identical or nearly identical, with no measurable performance difference.

@jkotas
Copy link
Member

jkotas commented Mar 3, 2020

This is just a cosmetic change that does not make anything faster. The existing code looks just fine.

@jkotas jkotas closed this Mar 3, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants