4 ms·
If override can only be those 3 and they're all non-zero, and default is when override is 0, then the following seems clearer in my opinion. if (override ? o
by jolmg 6y ago
If override can only be those 3 and they're all non-zero, and default is when override is 0, then the following seems clearer in my opinion.
if (override ? override == THING1 : foo == 42) {
code_here();
} else if (override ? override == THING2 : bar & 0x42) {
other_code();
} else if (override ? override == THING3 : true) {
more_code();
}