aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-06 06:44:11 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-06 06:44:11 +0000
commit034bbf1fddd2f5d5eff0712869e95580977efca8 (patch)
treea987bdab0c0b55f166117d9e5d87821a39d2c67a /numeric.c
parent9d184819146bb7d24b30fc54ef206d9a592c9be4 (diff)
downloadruby-034bbf1fddd2f5d5eff0712869e95580977efca8.tar.gz
opt_eq_func refactor
* vm_insnhelper.c (opt_eq_func): method to dispatch is resolved by only the receiver's class, not including the argument class. even if basic operation is redefined, other class conditions never meet. optimize Float and non-Float case, delegate to rb_float_equal directly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/numeric.c b/numeric.c
index 6afd95e896..3d2b501ab2 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1418,8 +1418,8 @@ num_equal(VALUE x, VALUE y)
*
*/
-static VALUE
-flo_eq(VALUE x, VALUE y)
+VALUE
+rb_float_equal(VALUE x, VALUE y)
{
volatile double a, b;
@@ -1442,6 +1442,8 @@ flo_eq(VALUE x, VALUE y)
return (a == b)?Qtrue:Qfalse;
}
+#define flo_eq rb_float_equal
+
/*
* call-seq:
* float.hash -> integer