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