12345678910111213141516 |
- $OpenBSD: patch-freehdl_kernel-list_hh,v 1.1 2017/06/03 14:25:16 espie Exp $
- improve the hash function.
- Index: freehdl/kernel-list.hh
- --- freehdl/kernel-list.hh.orig
- +++ freehdl/kernel-list.hh
- @@ -634,7 +634,7 @@ get_hash(const shared_array<T> &a) {
- unsigned int num = 0;
- const int UINT_BIT = sizeof(unsigned int) * CHAR_BIT;
- for (int i = 0; i < a.size(); i++)
- - num = ((num << 2) || ((UINT_BIT - 2) >> 30)) + get_hash(a.content(i));
- + num = ((num << 2) | ((UINT_BIT - 2) >> 30)) + get_hash(a.content(i));
- return num;
- }
-
|