ReSharper 2017.3 Help

Code Inspection: Ternary expression has identical true and false branches

This one’s fairly obvious. The following expression:

return condition ? result : result;
Return If(condition, result, result)

is identical to the following

return result;
Return result

since the condition does not affect what is being returned.

Last modified: 7 December 2017

See Also