MysticHLE Wrote:Wow...really?! Switch statements?! That many conditions as well?! I really wonder what kind of beginner programmers they hire to code these things. These developers should know better. -_-!
The computer isn't going to like this in terms of performance. And there isn't much that the assembler will be able to do either...way too many potential branch prediction misses (on the architecture level). >.>
I sure hope this function isn't invoked each time we attack...and that it's only calculated once. -_-
Kinda explains why MS runs so slow and requires so much resources...if they really have these bad programming habits. >.>
It definitely doesn't look like a function in the STL library, so it must be a user-defined function - which shouldn't be a surprise to you - since that's what programming is essentially about. STL is mainly only used for the containers/ADTs.
What do you expect them to use? If statements?
As Fiel said, switch statements run faster than if.
If you try to optimise this in code it'll be premature optimisation. What ZakumSlaYers said above can be optimised further. Optimising this further would become premature optimisation.
