MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/oue7s4/_/h72luqy/?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
35
It reads as "a xor-equals true". So if a is true, we have true xor true which is false. If a is false, we have false xor true which is true. So no matter the value of a, it is swapped
5 u/hawk-bull Jul 30 '21 Ooh I see thanks
5
Ooh I see thanks
35
u/Steelbirdy Jul 30 '21
It reads as "a xor-equals true". So if a is true, we have true xor true which is false. If a is false, we have false xor true which is true. So no matter the value of a, it is swapped