4 ms·
> Is there something I'm missing here? Yes (see other replies), and it's precisely the reason why this code shouldn't pass code review. At first glance the fi
by imron 10y ago
> Is there something I'm missing here?
Yes (see other replies), and it's precisely the reason why this code shouldn't pass code review.
At first glance the first example looks like it should fail but in fact works. The second example I provided looks like it should work, but in fact loops infinitely.
The first one is tricky and nifty, but prone to bugs. Using signed counters is better way to go about it.