aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2024-11-17 14:33:17 -0500
committerBruce Hill <bruce@bruce-hill.com>2024-11-17 14:33:17 -0500
commitc1ae79ac3c320923363994fb88f4cc2fa13317ce (patch)
tree350c2f1747b0896d6d120c1049a3bfed7cc5e38d /stdlib
parentb51cd728c63227fbe9d5650096d07021f808ca8c (diff)
Tweak hash function
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/integers.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/stdlib/integers.c b/stdlib/integers.c
index 4f1947d2..1973fa34 100644
--- a/stdlib/integers.c
+++ b/stdlib/integers.c
@@ -57,8 +57,7 @@ public PUREFUNC bool Int$equal_value(const Int_t x, const Int_t y) {
public PUREFUNC uint64_t Int$hash(const Int_t *x, const TypeInfo_t *type) {
(void)type;
if (__builtin_expect(x->small & 1, 1)) {
- int64_t i = (x->small>>2);
- return siphash24((void*)&i, sizeof(i));
+ return siphash24((void*)x, sizeof(Int_t));
} else {
char *str = mpz_get_str(NULL, 16, *x->big);
return siphash24((void*)str, strlen(str));