2 ms·
This is really less “sentinels can be faster” and more “assuming invariants can be faster because you’re reducing comparisons”.
by lowiqengineer 6y ago
This is really less “sentinels can be faster” and more “assuming invariants can be faster because you’re reducing comparisons”.
- lifthrasiir 6y agoThis. The whole argument only holds because you can choose `isspace` to return false for '\0'. You should be able to choose whichever sentinel fits to the required invariant, and C's global string "sentinel" is less useful in that regard. If you need a sentinel you should be able to push one beforehand anyway.