Fix some Codacy warnings - #6576
Closed
MarcelRaad wants to merge 8 commits into
Closed
Conversation
Increment `bytes` only if it is non-null. Closes
`end` is always non-null here. Closes
As suggested by Codacy/cppcheck. Closes
| if(bytes) { | ||
| /* get the number! */ | ||
| (void)curlx_strtoofft(bytes, NULL, 0, &size); | ||
| (void)curlx_strtoofft(++bytes, NULL, 0, &size); |
Member
There was a problem hiding this comment.
Minor nitpick: wouldn't it be more readable to just do bytes++; on its own line before the curlx_strtoofft call?
Member
Author
There was a problem hiding this comment.
Fine for me too. Personally, I find both equally readable. What do others think?
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
I put it on a separate line in the final commit that landed on master.
bagder
approved these changes
Feb 8, 2021
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
`end` is always non-null here. Closes curl#6576
MarcelRaad
added a commit
to MarcelRaad/curl
that referenced
this pull request
Feb 10, 2021
As suggested by Codacy/cppcheck. Closes curl#6576
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.
Mostly remove redundant code and reduce variable scopes.