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 about redundant assignment #3873

Closed
wants to merge 3 commits into from

Conversation

Projects
None yet
2 participants
@MarcelRaad
Copy link
Member

commented May 12, 2019

Remove a useless variable, narrow a variable scope, and initialize a variable with the correct value to fix them.

@MarcelRaad MarcelRaad added the tidy-up label May 12, 2019

@MarcelRaad MarcelRaad changed the title Fix some Codacy warning about redundant assignment Fix some Codacy warnings about redundant assignment May 12, 2019

@MarcelRaad

This comment has been minimized.

Copy link
Member Author

commented May 12, 2019

The "new" Codacy warning is just from moved code.

curl_socket_t sock = conn->sock[FIRSTSOCKET];
curl_socket_t fd_read = CURL_SOCKET_BAD;
fd_read = sock;
curl_socket_t fd_read = conn->sock[FIRSTSOCKET;

This comment has been minimized.

Copy link
@jay

jay May 13, 2019

Member

typo

@MarcelRaad MarcelRaad force-pushed the MarcelRaad:codacy_redundantassignment branch from 199c55a to 2670274 May 13, 2019

MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request May 13, 2019

ssh-libssh: remove unused variable
sock was only used to be assigned to fd_read.

Closes curl#3873

MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request May 13, 2019

ssh: move variable declaration to where it's used
This way, we need only one call to free.

Closes curl#3873

MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request May 13, 2019

tool_formparse: remove redundant assignment
Just initialize word_begin with the correct value.

Closes curl#3873

MarcelRaad added some commits May 12, 2019

ssh-libssh: remove unused variable
sock was only used to be assigned to fd_read.

Closes #3873
ssh: move variable declaration to where it's used
This way, we need only one call to free.

Closes #3873
tool_formparse: remove redundant assignment
Just initialize word_begin with the correct value.

Closes #3873

@MarcelRaad MarcelRaad force-pushed the MarcelRaad:codacy_redundantassignment branch from 2670274 to c57b8a2 May 19, 2019

MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request May 20, 2019

ssh: move variable declaration to where it's used
This way, we need only one call to free.

Closes curl#3873

MarcelRaad added a commit to MarcelRaad/curl that referenced this pull request May 20, 2019

tool_formparse: remove redundant assignment
Just initialize word_begin with the correct value.

Closes curl#3873

@MarcelRaad MarcelRaad deleted the MarcelRaad:codacy_redundantassignment branch May 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.