3 ms·
>`a | b` can be written as: `if !a && b { a = true }` `a || b` ... The repository does have multiple cases of `a || b` and none of the `a = true` kind, so per
by Arnavion 9y ago
>`a | b` can be written as: `if !a && b { a = true }`
`a || b` ...
The repository does have multiple cases of `a || b` and none of the `a = true` kind, so perhaps the author realized it after writing this blog post.
- thetic 9y agoThis one tripped me up too. I'm guessing he meant `a |= b`.
- Arnavion 9y agoOf course he meant that. My point was that `if !a && b { a = true; }` is a silly way to write `a = a || b;`
- teolandon 9y agoIt's right on the line wrap, but it actually says `a = a | b`. At least right now, not sure if they edited it.