Allow continue statement inside a switch with specific case instruction
#5458
samuelgozi
started this conversation in
Ideas/Requests
Replies: 1 comment
-
|
I've considers this approach numerous times and the answer is no.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Add new syntax to the
continuestatement that would allow it to jump to a specific case in a labeledswitch.This could improve performance by avoiding unnecessary failed branch predictions, and makes the code easier to follow.
Edit: I also think that this is a better option, possibly a replacement to
fallthrough, which requires the cases to be ordered in a specific way, and even then is very limited. This syntax allows precise control flow, withgotoperformance but in a controlled setting.Example:
Beta Was this translation helpful? Give feedback.
All reactions