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

refactor: refactor useless else block in the loop #46

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

deepsource-autofix[bot]
Copy link
Contributor

When a loop specifies no break statement, the else clause will always execute when the loop sequence is empty, thus making it useless.
It is recommended to have the statements under else in the same scope as the loop itself.
If the else clause does not always execute at the end of a loop clause, then the code should add a break statement within the loop block.

When a loop specifies no break statement, the else clause will always execute when the loop sequence is empty, thus making it useless.
It is recommended to have the statements under else in the same scope as the loop itself.
If the else clause does not always execute at the end of a loop clause, then the code should add a break statement within the loop block.
@itsHenry35 itsHenry35 merged commit 384edad into main Sep 28, 2024
5 of 6 checks passed
@itsHenry35 itsHenry35 deleted the deepsource-autofix-8efb815c branch January 21, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant