NeoMutt  2024-10-02-34-g9dd811
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
Case-insensitive fixed-chunk comparisons

These functions are much faster for short strings than calling mutt_istr_equal(), and are not affected by locale in any way.

But you will need to do length checking yourself, and the right-hand side (b) is assumed to already be lowercased. It also is assumed to be constant, so that the generated 0x20 mask (for lowercasing) will be generated compile-time.

In general, you want the fewest possible comparison calls; on most platforms, these will all generally be the same speed. So if you e.g. have an 11-byte value, it's cheaper to call eqi8() and eqi4() with a one-byte overlap than calling eqi8(), eqi2() and eqi1(). Similarly, if your value is 8 bytes, you can ignore the fact that you know what the first byte is, and do a full eqi8() compare to save time. There are helpers (e.g. eqi11()) that can help with the former.