Code Inspection: 'if' statement can be re-written as '?:' expression
The conditional ?: (ternary) operator in C# is the most elegant way to execute one of two simple expressions depending on the value of a simple boolean expression.
Therefore, if Rider encounters an
if...else statement in this context, it suggests to convert it to a more succinct
Here is an example of a quick-fix suggested by this inspection:
|Suboptimal code||After the quick-fix|