-
Notifications
You must be signed in to change notification settings - Fork 457
Switch from strtol to hts_str2uint in mod parsing #1957
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
base: develop
Are you sure you want to change the base?
Conversation
Looks like a good idea. If you lift the declarations of |
I'd agree that lofting particularly It would also be a good idea to change the |
sam_mods.c
Outdated
if (cp != state->MM[i]) | ||
state->MMcount[i] = strtol(cp+1, NULL, 10); | ||
else | ||
if (cp != state->MM[i]) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And now there's no need to modify a bunch of surrounding lines by adding { … }
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed.
: 0; | ||
if (!cp_end) { | ||
// empty list | ||
if (*cp == ',') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkbonfield This site made me think for a minute; the interplay of the ternary and the if(!cp_end)
worried me. I believe I have the logic correct, it reads a little more direct now as a consequence.
This saves around 10-15% in programs calling the modified base APIs.