Quote:
Originally Posted by Twinny
Thus the major thing I've been wondering about. I was thinking cases would be similar to checking an array for a match since it's only comparing the case "blah": line. I think it would be very close in terms of efficiency. You could argue that once a match is found serverside, it has to go through all cases below it but does it actually process cases since it has found it's match already?
Also, my method doesn't send incorrect commands serverside  . Kuji would need another .index() for this thus less efficiency clientside  .
|
No, it stops processing cases after it has found a match and runs the code held therein regardless of case (that is, without breaking the loop). I agree in that they are close in efficiency, however from the post, #2 is still more efficient. And as I stated in my first post, simple changes could make both even better, eventually making #1 the more efficient.
An array would do the trick.