From 0964b60f917392f7a827b3b2090cc2188d08f1fd Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 30 Aug 2006 03:02:35 +0000 Subject: * numeric.c (flo_hash): improve collision. * string.c (rb_memhash): new generic function to calculate hash value for memory chunk. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 3000158be..255b6b52b 100644 --- a/numeric.c +++ b/numeric.c @@ -836,15 +836,11 @@ static VALUE flo_hash(VALUE num) { double d; - char *c; - int i, hash; + int hash; d = RFLOAT(num)->value; if (d == 0) d = fabs(d); - c = (char*)&d; - for (hash=0, i=0; iklass; if (hash < 0) hash = -hash; return INT2FIX(hash); } -- cgit