----- Original Message ----- From: "Allandt Bik-Elliott (Receptacle)" <[EMAIL PROTECTED]>
To: "flashcoders" <[email protected]>
Sent: Wednesday, June 25, 2008 3:12 PM
Subject: [Flashcoders] switch statement more efficient than if...else?


Hi guys

quick question that came up in a conversation I had the other day - are switch statements more or less efficient than a series of if...else statements in either AS2 or AS3?

I'd always thought that the most efficient was the switch

I doubt that there's anything in it - the compiler writes your if statement for you with a switch statement.

It would be better to be more concerned about readability and maintainability, where the switch statement will win hands down for many cases.. ;-)

Paul

al.z

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to