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 | 285bf5af03e9271c1222dde5986dd8ee2432445a (patch) | |
| tree | 1fa2322bd80516cece3046c76a820c91afd51c1e | |
| parent | 5cbc6bff93854ee0270c362adb8054520559863e (diff) | |
| download | ruby-285bf5af03e9271c1222dde5986dd8ee2432445a.tar.gz ruby-285bf5af03e9271c1222dde5986dd8ee2432445a.tar.xz ruby-285bf5af03e9271c1222dde5986dd8ee2432445a.zip | |
* numeric.c (flo_hash): improve collision. fixed: [ruby-dev:29352]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@10864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | numeric.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Tue Sep 5 05:56:51 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * numeric.c (flo_hash): improve collision. fixed: [ruby-dev:29352] + Tue Sep 5 05:49:41 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> * file.c (path_check_0): check if sticky bit is set on parent @@ -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); |
