ports/lang/freehdl/patches/patch-freehdl_kernel-list_hh

15 lines
465 B
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
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;
}