View Single Post
  #15  
Old 09-23-2015, 10:04 PM
Uleat's Avatar
Uleat
Developer
 
Join Date: Apr 2012
Location: North Carolina
Posts: 2,815
Default

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
Reply With Quote