Performance of if statement versus switch statement

Posted by behrk2 on Stack Overflow See other posts from Stack Overflow or by behrk2
Published on 2010-03-29T15:00:01Z Indexed on 2010/03/29 15:03 UTC
Read the original article Hit count: 673

Hi Everyone,

I have an if statement with 16 cases (I am checking the state of four boolean variables). Would there be any value in trying to implement this differently, with nested switch statements perhaps?

What is the actual performance gain of a switch statement over an if statement?

Thanks!

© Stack Overflow or respective owner

Related posts about if-statement

Related posts about switch-statement