From 4a43890fb440692bc9301059cff84eaf13c8b1b1 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 25 Jul 2009 04:44:36 +0000 Subject: * complex.c (nucomp_hash), rational.c (nurat_hash): not to use hash value of class so that equality against subclasses can work. [ruby-dev:38850] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- complex.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'complex.c') diff --git a/complex.c b/complex.c index fcaf2d821..ee281ba81 100644 --- a/complex.c +++ b/complex.c @@ -1156,15 +1156,14 @@ nucomp_numerator(VALUE self) static VALUE nucomp_hash(VALUE self) { - long v, h[3]; + long v, h[2]; VALUE n; get_dat1(self); - h[0] = rb_hash(rb_obj_class(self)); n = rb_hash(dat->real); - h[1] = NUM2LONG(n); + h[0] = NUM2LONG(n); n = rb_hash(dat->imag); - h[2] = NUM2LONG(n); + h[1] = NUM2LONG(n); v = rb_memhash(h, sizeof(h)); return LONG2FIX(v); } -- cgit