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

Fix some Codacy warnings #6576

Closed
wants to merge 8 commits into from
Closed

Conversation

@MarcelRaad
Copy link
Member

@MarcelRaad MarcelRaad commented Feb 8, 2021

Mostly remove redundant code and reduce variable scopes.

/* get the number! */
(void)curlx_strtoofft(bytes, NULL, 0, &size);
(void)curlx_strtoofft(++bytes, NULL, 0, &size);
Copy link
Member

@danielgustafsson danielgustafsson Feb 8, 2021

Minor nitpick: wouldn't it be more readable to just do bytes++; on its own line before the curlx_strtoofft call?

Copy link
Member Author

@MarcelRaad MarcelRaad Feb 8, 2021

Fine for me too. Personally, I find both equally readable. What do others think?

Copy link
Contributor

@jzakrzewski jzakrzewski Feb 8, 2021

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.

Copy link
Member

@bagder bagder Feb 8, 2021

I'm equally fine with either.

Copy link
Member Author

@MarcelRaad MarcelRaad Feb 10, 2021

I put it on a separate line in the final commit that landed on master.

bagder
bagder approved these changes Feb 8, 2021
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
`end` is always non-null here.

Closes curl#6576
MarcelRaad pushed a commit to MarcelRaad/curl that referenced this issue Feb 10, 2021
As suggested by Codacy/cppcheck.

Closes curl#6576
@MarcelRaad MarcelRaad deleted the codacy_error_prone branch Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants