ReSharper Syntax Suggestion

The if keyword in the following expression is underlined in green ReSharper:

if (readOnlyFields.Contains(propertyName)) return false;

return base.CanWriteProperty(propertyName);

ReSharper offers the following change:

return !readOnlyFields.Contains(propertyName) 
    && base.CanWriteProperty(propertyName);

Why is it "better"? I find the current code more readable, and the result should be the same as I know. Any thoughts?

+3
source share
4 answers

None of them are better in the sense that any of them will be better than the other. (Any difference will be completely negligible.)

, return , . , , . , , , :

if (readOnlyFields.Contains(propertyName)) return false;
else return base.CanWriteProperty(propertyName);

.

+3

(Alt + Enter) "" ( - ). .

ReSharper.

+2

.

, .

+2

"" . , .

, ReSharper. , , . , .

, " ". , .

+2

All Articles