summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-05-09 14:22:23 +0200
committerTyge Løvset <[email protected]>2022-05-09 14:22:23 +0200
commita34354bd24d81949567a1480209a2f7bbbe3bfbe (patch)
tree72adf4c0c844913dd0bb975cbfbc805a0549a15b /include
parente9c30e66af9c5c3054735eeb65c0bb384dea96b4 (diff)
downloadSTC-modified-a34354bd24d81949567a1480209a2f7bbbe3bfbe.tar.gz
STC-modified-a34354bd24d81949567a1480209a2f7bbbe3bfbe.zip
Small improvement in c_default_hash()
Diffstat (limited to 'include')
-rw-r--r--include/stc/ccommon.h2
1 files changed, 1 insertions, 1 deletions
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;