有谁知道对正好有 6 个字符的字符串进行字符串比较的最快方法是什么?
我的想法如下:
inline bool jfStrEq6(const char *s1, const char *s2)
{
uint64_t s1ui64 = *((uint64_t *)s1);
uint64_t s2ui64 = *((uint64_t *)s2);
return (s1ui64 & 0x0000ffffffffffff) == (s2ui64 & 0x0000ffffffffffff);
}