crossbeam
crossbeam copied to clipboard
queue/SegQueue: simplify len calculation
It seems a new version of cfg-if breaks the CI instead of the patch.
This is a nice optimisation and it seems correct in that assuming tail >= head
, Z3 tells me that the PR'd implementation is exactly equivalent to the current one on both 32-bit and 64-bit systems, except for when tail == 2**32 - 2
or tail == 2**64 - 2
, respectively. I have no idea how the queue works - is this something to worry about? CC @stjepang @taiki-e
P.S. Sorry for taking a year to review..