Closed v-chernyshev closed 2 years ago
Hi, and thanks for your question.
There is no real strong reason, but the idea was that these operations can be better optimised by the compiler, so they may result in marginally better performance.
See for instance here for an explanation:
https://en.wikipedia.org/wiki/Short-circuit_evaluation#Reduced_efficiency_due_to_constraining_optimizations
Hi, I've noticed that pretty much the whole library uses
&
and|
instead of&&
and||
(see e.g. this example). What is the reason behind it? Unlike logical operators, the bitwise ones don't benefit from short-circuit evaluation.