> So the intent of the code is to avoid the expense of calling memcmp if a > full n-character memcmp can't possibly find equality at i (due to mismatch > of first characters), and the assumption is that first characters mismatch > frequently. Both seem like good calls to me! However, smart compilers (gcc 2.95+ fer instance) will produce an inline memcmp call that is faster, and has no overhead (IE it's not making a library call). Thus, the first character mismatch test is useless. We had the same thing in strcmp macros in GDB, where we tested the first character, then strcmp'd. It was faster to just strcmp, even when they *did* mismatch. --Dan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4