ReSharper
 
Get ReSharper
You are viewing the documentation for an earlier version of ReSharper.

Code Inspection: Redundant 'case' label

Last modified: 21 July 2022

Empty case sections before the default case in a switch statement do not make any sense because code corresponding to their conditions will be executed in the default case anyway. ReSharper suggests removing such empty case sections:

Note that empty case sections before a non-empty case section are valid and mean that the code in the non-empty case section executes for all cases that go before it.