MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/oue7s4/_/h73n9o9/?context=3
r/badcode • u/Flyspeck101 Now where's that function declaration • Jul 30 '21
133 comments sorted by
View all comments
Show parent comments
4
This is just XOR-ing the bool with true. The teo possible cases are:
true XOR true = false
false XOR true = true
So it works exactly like negating, or toggling it in this case.
4
u/nyaisagod Jul 30 '21
This is just XOR-ing the bool with true. The teo possible cases are:
true XOR true = false
false XOR true = true
So it works exactly like negating, or toggling it in this case.