Can I replace an if-statement with AND?

My prof once said, that if-statements are rather slow and should be avoided as much as possible. I’m making a game in OpenGL, where I need a lot of them. In my tests replacing an if-statement with AND via short-circuiting worked, but is it faster? bool doSomething(); int main() { int randomNumber = std::rand() %… Read More Can I replace an if-statement with AND?