-
-
Notifications
You must be signed in to change notification settings - Fork 326
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
gui: Early exit from functions or loops #4916
base: main
Are you sure you want to change the base?
Conversation
Flattens nested conditionals and moves error messages or returns near the top
Flattens nested conditionals and moves error messages near the top
(self.GCPcount >= 3 or self.gr_order != 1) | ||
and (self.GCPcount >= 6 or self.gr_order != 2) | ||
and (self.GCPcount >= 10 or self.gr_order != 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be correct, but it's completely unreadable. Maybe evaluate these separately before?
(self.GCPcount >= 3 or self.gr_order != 1) | ||
and (self.GCPcount >= 6 or self.gr_order != 2) | ||
and (self.GCPcount >= 10 or self.gr_order != 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same comment here.
(self.GCPcount >= 3 or self.gr_order != 1) | ||
and (self.GCPcount >= 6 or self.gr_order != 2) | ||
and (self.GCPcount >= 10 or self.gr_order != 3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same comment here.
Analogous to #4910, but for files in gui/.
I verified all the changes when committing them to make sure they are equivalent and that they kept the comments. The places I was unsure I reverted them, so these are the ones that make sense