Code inspection: Replace with single assignment
This inspection reports a two-step boolean assignment that first assigns false and then conditionally assigns true. That pattern is equivalent to assigning the condition directly.
Example
bool result = false;
if (condition)
result = true;
bool result = condition;
Quick-fix
Replace the two-step assignment with a single assignment.
29 March 2026