mirror of
https://github.com/dmunozv04/iSponsorBlockTV.git
synced 2025-12-31 11:56:46 +03:00
refactor: refactor unnecessary else / elif when if block has a continue statement
The use of `else` or `elif` becomes redundant and can be dropped if the last statement under the leading `if` / `elif` block is a `continue` statement. In the case of an `elif` after `continue`, it can be written as a separate `if` block. For `else` blocks after `continue`, the statements can be shifted out of `else`. Please refer to the examples below for reference. Refactoring the code this way can improve code-readability and make it easier to maintain.
This commit is contained in:
committed by
GitHub
parent
784d54c4e2
commit
35453bc49e
@@ -145,7 +145,7 @@ def main(config, debug: bool) -> None:
|
|||||||
channel_info["name"] = input("Enter the channel name: ")
|
channel_info["name"] = input("Enter the channel name: ")
|
||||||
channel_whitelist.append(channel_info)
|
channel_whitelist.append(channel_info)
|
||||||
continue
|
continue
|
||||||
elif choice == "6":
|
if choice == "6":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
channel_info["id"] = results[int(choice)][0]
|
channel_info["id"] = results[int(choice)][0]
|
||||||
|
|||||||
Reference in New Issue
Block a user