Skip to content

Comments

[IfChainToSwitch] Add support for if predicates that contain multiple comparisons ORed together, e.g. ... else if(x == 1 || x == 2) {...} ... transforms to switch (x) { ... case 1, 2 -> {...} ...}. Also supports enum comparison.#5528

Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
test_874223965

Conversation

@copybara-service
Copy link
Contributor

[IfChainToSwitch] Add support for if predicates that contain multiple comparisons ORed together, e.g. ... else if(x == 1 || x == 2) {...} ... transforms to switch (x) { ... case 1, 2 -> {...} ...}. Also supports enum comparison.

…le comparisons ORed together, e.g. `... else if(x == 1 || x == 2) {...} ... ` transforms to `switch (x) { ... case 1, 2 -> {...} ...}`. Also supports enum comparison.

PiperOrigin-RevId: 874223965
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant