simplify loop in collect_exts_file_info#4689
Open
Flamefire wants to merge 4 commits intoeasybuilders:developfrom
Open
simplify loop in collect_exts_file_info#4689Flamefire wants to merge 4 commits intoeasybuilders:developfrom
collect_exts_file_info#4689Flamefire wants to merge 4 commits intoeasybuilders:developfrom
Conversation
b3a7782 to
640b3ea
Compare
Member
|
@Flamefire I changed to target branch in this PR from |
640b3ea to
057f268
Compare
057f268 to
925909a
Compare
Contributor
Author
|
Rebased |
925909a to
caef5c9
Compare
caef5c9 to
d8d1fc5
Compare
Member
|
@Flamefire CI isn't happy with this? |
d8d1fc5 to
19d35a5
Compare
Contributor
Author
|
Looks like I over-indented one line. Fixed with rebase amending the faulty commit |
The loop body is so large, that the allowed/checked types are very hard to find.
When we only have a name, just continue and avoid the extra indent
b0cb62e to
0a7b0b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The loop over
exts_listuses an excessive amount of branches and hence indentation making it hard to read.We have 3 simple cases:
Moving the type check to the top of the loop makes it instantly visible which types are accepted, the
elifs at the bottom are hard to find after all the indents.Using
continueafter handling the simple cases reduces the indentation by 2 levels and makes it clear, that nothing else is done for those.