| pipe symbol is a bit-wise operator.
|a & b means you apply a logical OR to all bits of a (producing a single bit), and then do a logical & with b.
|a has no effect when a is a single bit.
if not in front of a variable
|| is or
| is or for single bit variable
For example
if (a && !(|b))
// if a is 1, b is full of 0, will 进入if
|= means?
x |= y; same thing as: x = x | y;
|= will only add bits to target
a |= b is equivalent to a = a | b except that a is evaluated only once
a &= b is equivalent to a = a & b except that a is evaluated only once