Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-core-dev] Replaced use of ^ operator with & ~



Glancing through usage of the XOR operator, Jerome and I noticed it was
often slightly misused to clear a bit.
Remember that in order to safely clear bits, one should rather use the & ~
operators.

e.g.

    3 ^ 1  -->  2        3 & ~1 --> 2
but
    2 ^ 1  --> 3         2 & ~1 --> 2


I fixed them all to use &~.



Back to the top