Open
Conversation
- removed memset calls I don't think filling the structure pointers wasted time more than anything - replaced some unnecessary allocation with stack-based arrays - replaced strcmp with a for loop so it's slightly faster because ends slightly sooner - removed strlen calls in fons__fopen (based on stb_image, it seems these aren't required) note: if this causes some problems, it'd still be better to replace it with a for loop that iterates through both strings so it's not doing two separate loops per string. - made it so if end == NULL it just iterates the string until it reaches '0' instead of setting end to the end. This makes it so it only loops through the string once. (Again, because strlen is doing a loop through the string).
oops
Nairou
reviewed
Jul 13, 2023
(not sure if that's the only one)
… of holding onto it
…ld the font data for some reason. I really think this should be changed somehow.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
removed memset calls I don't think filling the structure pointers wasted time more than anything
replaced some unnecessary allocation with stack-based arrays
replaced strcmp with a for loop so it's slightly faster because ends slightly sooner
removed strlen calls in fons__fopen (based on stb_image, it seems these aren't required)
note: if this causes some problems, it'd still be better to replace it with a for loop that iterates through both strings so it's not doing two separate loops per string.