improve hash calculation

This commit is contained in:
stefani 2015-04-29 17:19:55 +02:00
parent e3652d8901
commit 8f469b108e

View File

@ -53,7 +53,7 @@ static unsigned int target_address_hash(unsigned long key)
} u = { .addr = ARCH_ADDR_T(key) }; } u = { .addr = ARCH_ADDR_T(key) };
for (i = 0; i < ARRAY_SIZE(u.v); ++i) for (i = 0; i < ARRAY_SIZE(u.v); ++i)
h = (h >> 1) ^ u.v[i]; h += (h >> 2) ^ (u.v[i] << 3);
return h; return h;
} }