Is a bitmask-based check more efficient than comparing numbers?
Compare the following two methods of performing a check:
In both cases, the value of
val must be fetched from memory. Does the compiler do something special with bitmask-based checks, making them more efficient than number comparisons?