Yes, Shendare's method is more efficient!
Switch statements essentially create a jump table entry (per case value) and code paths for each entry listed in the machine code.
If no exit clause is specified, the code path will 'fall-through' every line of code until it reaches the default exit clause..meaning that every case between case entry and
default exit will be processed as true.
The fall-through behavior can be very useful for grouping like singular and progressive-compound methodologies..but, it can also be a trap if that behavior is not desired.
__________________
Uleat of Bertoxxulous
Compilin' Dirty
|