diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 20:57:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 20:57:02 +0000 |
commit | dfac39ff8d6a080f5cb3faea44b53dbdec5e06ae (patch) | |
tree | 1fa2322bd80516cece3046c76a820c91afd51c1e /numeric.c | |
parent | 401ff253ef38889be85d9cc3f06ef98d7c2a35a2 (diff) |
* numeric.c (flo_hash): improve collision. fixed: [ruby-dev:29352]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -870,7 +870,7 @@ flo_hash(num) if (d == 0) d = fabs(d); c = (char*)&d; for (hash=0, i=0; i<sizeof(double);i++) { - hash += c[i] * 971; + hash = (hash * 971) ^ (unsigned char)c[i]; } if (hash < 0) hash = -hash; return INT2FIX(hash); |