From 59e76275ba78950966cc3bba4db1500e0ea8421f Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Tue, 27 Aug 2019 10:39:39 +0300 Subject: [PATCH] Unify variable names in hash functions --- c/ptrhash.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/c/ptrhash.c b/c/ptrhash.c index 14da186..32af04f 100644 --- a/c/ptrhash.c +++ b/c/ptrhash.c @@ -24,16 +24,16 @@ #define OP_EQ(x, y) ((x) == (y)) #ifdef BITS64 -static uint64_t _pinthash(uint64_t key) +static uint64_t _pinthash(uint64_t a) { - key = (~key) + (key << 21); // key = (key << 21) - key - 1; - key = key ^ (key >> 24); - key = (key + (key << 3)) + (key << 8); // key * 265 - key = key ^ (key >> 14); - key = (key + (key << 2)) + (key << 4); // key * 21 - key = key ^ (key >> 28); - key = key + (key << 31); - return key; + a = (~a) + (a << 21); // a = (a << 21) - a - 1; + a = a ^ (a >> 24); + a = (a + (a << 3)) + (a << 8); // a * 265 + a = a ^ (a >> 14); + a = (a + (a << 2)) + (a << 4); // a * 21 + a = a ^ (a >> 28); + a = a + (a << 31); + return a; } #else static uint32_t _pinthash(uint32_t a)