|
Me and impulse had this discussion with the elseif/if vs a case statement.
As Korvacs stated above it does depend on how many conditions your checking as to which one is more effective.
If I remember right there will be no noticeable difference between using else if's and a case statement unless there is something like 50 difference conditions to check, but in all seriousness, for efficiency if I remember right(again) when using 1, 2, 3 or even four if's it will out perform the case statement untill you start to get to about 10(or 5 as Korvacs appears to of actually conducted test's of his own).
My point is, in this instance the if's will more than likely out perform a case statement.
#note: when I say the "case statement" I mean the switch statement with the case's inside, I just can't be bothered to go edit it.
|