Convert if-else into conditional expression
else return or assignment expression into a conditional expression.
Why is this refactoring helpful?
? is a better fit. When you are familiar with conditional expressions, single-level conditional expressions are more concise and often easier to understand than if-else statements.
- Code Assist ID (for the configuration file):
- You can configure custom keyboard shortcuts with these code action kinds:
- This code assist provides refactoring suggestions. Learn how to configure the refactoring suggestion visibility.