Remove Redundant Assignment
Removes the initialization of a variable if it is initialized with the default value.
Available when the caret is on the name of a field in its declaration, provided that the field is initialized with the default value.
Place the caret on the name of a field in its declaration.
The blinking cursor shows the caret’s position at which the Refactoring is available.
- Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
- Select Remove Redundant Assignment from the menu.
After execution, the Refactoring removes the assignment, which does not change code behavior.