coderushforroslyn-115576-refactoring-assistance-simplify-expression.md
Used to simplify a boolean expression or bitwise operation if it is possible. The simplification involves removing unnecessary parentheses, toggling negations, parameter reordering, etc. without affecting the expression’s return value but making the entire expression easier to read.
Available in the following cases:
Place the caret on an if statement whose condition can be simplified.
Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
Select Simplify Expression from the menu.
After execution, the Refactoring replaces the condition with a simpler equivalent.
if (a || c)
return;
If a OrElse c Then
Return
End If
Note
This Refactoring uses the Quine–McCluskey algorithm for simplification.
See Also