3 ms·
Why is is_empty comparing to bigger than zero instead of equals?
by htk 5y ago
Why is is_empty comparing to bigger than zero instead of equals?
- jb1991 5y agoThat’s a common optimization, not just with this particular requirement. Choose the thing that is most ambiguous that gives you the answer you need, and it’s more likely to result in a simpler hardware instruction.
- rafaelvasco 5y agoProbably because , for this case, comparing for > or < is faster than equality comparison. Which from my experience is true.
- htk 5y agoThe author edited the article and corrected is_empty to is_not_empty.