ReSharper
 
Get ReSharper
Get your hands on the new features ahead of the release by joining the Early Access Program for ReSharper 2025.1! Learn more

Code inspection: '?:' expression has identical true and false branches

Last modified: 11 February 2024

This one’s fairly obvious. The following expression:

return condition ? result : result;

is identical to the following

return result;

since the condition does not affect what is being returned.