Jon Wilder
Active Member
Not sure if this is just a matter of style preference or if this actually changes the manner in which your code is compiled, but when more than one satisfied condition can call the same function, is it more efficient to do nested if statements? Or is it more efficient to do something like this -
Here is the non-obfuscated version -
Code:
if( ( (var1) && (((var2 & 0xF0) == 0xB0) || ((var2 & 0xF0) == 0xC0)) ) ||
( (!var1) && ((var2 == (var3 + var4) || (var2 == (var3 + var5)) ) ) {
someFunction();
}
Here is the non-obfuscated version -
Code:
if(var1) {
if((var2 & 0xF0) == 0xB0) {
someFunction();
}
if((var2 & 0xF0) == 0xC0) {
someFunction();
}
}else if((!var1) {
if((var2 == (var3 + var4)) {
someFunction();
}
if((var2 == (var3 + var5)) {
someFunction();
}
}
Last edited: