When the comparison is performed on an enum, using a switch statement can allow for additional compiler optimizations.