Commit 8c36141
authored
refactor: refactor unnecessary
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.else / elif when if block has a continue statement1 parent a1cd3b7 commit 8c36141
4 files changed
Lines changed: 22 additions & 28 deletions
File tree
- src/omnipkg
- installation
- isolation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1235 | 1235 | | |
1236 | 1236 | | |
1237 | 1237 | | |
1238 | | - | |
| 1238 | + | |
1239 | 1239 | | |
1240 | 1240 | | |
1241 | 1241 | | |
| |||
12062 | 12062 | | |
12063 | 12063 | | |
12064 | 12064 | | |
12065 | | - | |
| 12065 | + | |
12066 | 12066 | | |
12067 | 12067 | | |
12068 | 12068 | | |
12069 | | - | |
12070 | | - | |
12071 | | - | |
| 12069 | + | |
| 12070 | + | |
12072 | 12071 | | |
12073 | 12072 | | |
12074 | 12073 | | |
| |||
12227 | 12226 | | |
12228 | 12227 | | |
12229 | 12228 | | |
12230 | | - | |
| 12229 | + | |
12231 | 12230 | | |
12232 | 12231 | | |
12233 | | - | |
| 12232 | + | |
12234 | 12233 | | |
12235 | 12234 | | |
12236 | 12235 | | |
| |||
12277 | 12276 | | |
12278 | 12277 | | |
12279 | 12278 | | |
12280 | | - | |
| 12279 | + | |
12281 | 12280 | | |
12282 | 12281 | | |
12283 | 12282 | | |
12284 | 12283 | | |
12285 | 12284 | | |
12286 | 12285 | | |
12287 | | - | |
12288 | | - | |
12289 | | - | |
12290 | | - | |
12291 | | - | |
| 12286 | + | |
| 12287 | + | |
| 12288 | + | |
| 12289 | + | |
12292 | 12290 | | |
12293 | 12291 | | |
12294 | 12292 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
| 349 | + | |
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
| |||
385 | 384 | | |
386 | 385 | | |
387 | 386 | | |
388 | | - | |
| 387 | + | |
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5900 | 5900 | | |
5901 | 5901 | | |
5902 | 5902 | | |
5903 | | - | |
5904 | | - | |
5905 | | - | |
5906 | | - | |
5907 | | - | |
5908 | | - | |
| 5903 | + | |
| 5904 | + | |
| 5905 | + | |
| 5906 | + | |
5909 | 5907 | | |
5910 | 5908 | | |
5911 | 5909 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1000 | 1000 | | |
1001 | 1001 | | |
1002 | 1002 | | |
1003 | | - | |
1004 | | - | |
1005 | | - | |
| 1003 | + | |
| 1004 | + | |
1006 | 1005 | | |
1007 | 1006 | | |
1008 | 1007 | | |
| |||
0 commit comments