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);

This comment has been minimized.

@danielgustafsson

danielgustafsson Feb 8, 2021
Member

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

This comment has been minimized.

@MarcelRaad

MarcelRaad Feb 8, 2021
Author Member

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

This comment has been minimized.

@jzakrzewski

jzakrzewski Feb 8, 2021
Contributor

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.

This comment has been minimized.

@bagder

bagder Feb 8, 2021
Member

I'm equally fine with either.

This comment has been minimized.

@MarcelRaad

MarcelRaad Feb 10, 2021
Author Member

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

@bagder
bagder approved these changes Feb 8, 2021
MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Feb 10, 2021
Closes curl#6576
MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Feb 10, 2021
Closes curl#6576
MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Feb 10, 2021
Closes curl#6576
MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Feb 10, 2021
Closes curl#6576
MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request Feb 10, 2021
Closes curl#6576
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
@MarcelRaad MarcelRaad deleted the MarcelRaad: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
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants