-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Fix some Codacy warnings #6576
Fix some Codacy warnings #6576
Conversation
Increment `bytes` only if it is non-null. Closes
`end` is always non-null here. Closes
As suggested by Codacy/cppcheck. Closes
/* get the number! */ | ||
(void)curlx_strtoofft(bytes, NULL, 0, &size); | ||
(void)curlx_strtoofft(++bytes, NULL, 0, &size); |
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.
Minor nitpick: wouldn't it be more readable to just do bytes++;
on its own line before the curlx_strtoofft
call?
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.
Fine for me too. Personally, I find both equally readable. What do others think?
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.
As much as I like terse code, ++bytes;
on a separate line makes it easier not to miss. It's not a strong opinion, however.
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.
I'm equally fine with either.
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.
I put it on a separate line in the final commit that landed on master.
`end` is always non-null here. Closes curl#6576
As suggested by Codacy/cppcheck. Closes curl#6576
Mostly remove redundant code and reduce variable scopes.