Skip to main content
gamedev.net
🔒 Locked

switch() or if()?

Started by Daishim Jun 2, 2002 at 10:13 PM 0 replies 200+ views
Original Post
Daishim
Daishim
I think I remember hearing something about a string of if statements are actually faster than a switch statement. Do I remember correctly? ... or is this false?

I know only that which I know, but I do not know what I know.
thuned
thuned
Usually, if you can use a switch, then use a switch. It is generally a tiny bit faster than a string of if''s.
life is unfair, take advantage of it.UNMB2 - if the link doesn't work, try clicking it :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.