summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-25 12:41:52 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-12-25 12:41:52 (GMT)
commitbaa53f625d9a74adc457be948746c67d9eb511e8 (patch)
tree7cceb1c55e40d852998b76d842c33167c92b4ae6 /hash.c
parentce52dfde9cd0bc7e22be6b5d62835cb348e076a2 (diff)
hash.c: prime2
* hash.c (prime2): turned into a uint32_t prime, as the lower 32bits, non-prime part only was used always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hash.c b/hash.c
index 285f611..4452eee 100644
--- a/hash.c
+++ b/hash.c
@@ -224,7 +224,7 @@ rb_any_hash(VALUE a)
/* Here we two primes with random bit generation. */
static const uint64_t prime1 = ((uint64_t)0x2e0bb864 << 32) | 0xe9ea7df5;
-static const uint64_t prime2 = ((uint64_t)0xcdb32970 << 32) | 0x830fcaa1;
+static const uint32_t prime2 = 0x830fcab9;
static inline uint64_t
@@ -253,7 +253,7 @@ key64_hash(uint64_t key, uint32_t seed)
long
rb_objid_hash(st_index_t index)
{
- return (long)key64_hash(rb_hash_start(index), (uint32_t)prime2);
+ return (long)key64_hash(rb_hash_start(index), prime2);
}
static st_index_t
@@ -290,7 +290,7 @@ rb_ident_hash(st_data_t n)
}
#endif
- return (st_index_t)key64_hash(rb_hash_start((st_index_t)n), (uint32_t)prime2);
+ return (st_index_t)key64_hash(rb_hash_start((st_index_t)n), prime2);
}
static const struct st_hash_type identhash = {