From a34354bd24d81949567a1480209a2f7bbbe3bfbe Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 9 May 2022 14:22:23 +0200 Subject: Small improvement in c_default_hash() --- include/stc/ccommon.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/stc/ccommon.h b/include/stc/ccommon.h index b0342928..68e45f43 100644 --- a/include/stc/ccommon.h +++ b/include/stc/ccommon.h @@ -123,7 +123,7 @@ STC_INLINE uint64_t c_fasthash(const void* key, size_t len) { uint32_t u4; const uint8_t *x = (const uint8_t*) key; while (n--) - memcpy(&u8, x, 8), x += 8, h += (h << 10) ^ (u8*0xc6a4a7935bd1e99d); + memcpy(&u8, x, 8), x += 8, h += (_c_ROTL(u8, 26) ^ u8)*0xc6a4a7935bd1e99d; switch (len &= 7) { case 0: return h; case 4: memcpy(&u4, x, 4); return h + u4*0xc6a4a7935bd1e99d; -- cgit v1.2.3