From f80c76f92efd79cc2918b8e57c8a400c7583caf1 Mon Sep 17 00:00:00 2001 From: mrkn Date: Tue, 22 Nov 2016 05:21:12 +0000 Subject: complex.c: optimize f_gt_p some cases * complex.c (f_gt_p): optimize f_gt_p for specific types of arguments. * internal.h (rb_int_gt, rb_float_gt, rb_rational_cmp): exported. * numeric.c (rb_float_gt): rename from flo_gt and be exported. * numeric.c (rb_int_gt): rename from int_gt and be exported. * rational.c (rb_rational_cmp): rename from nurat_cmp and be exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56872 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- rational.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'rational.c') diff --git a/rational.c b/rational.c index f2b83a347a..f7af5ca353 100644 --- a/rational.c +++ b/rational.c @@ -1063,8 +1063,8 @@ nurat_expt(VALUE self, VALUE other) * Rational(1,3) <=> 1 #=> -1 * Rational(1,3) <=> 0.3 #=> 1 */ -static VALUE -nurat_cmp(VALUE self, VALUE other) +VALUE +rb_rational_cmp(VALUE self, VALUE other) { if (RB_INTEGER_TYPE_P(other)) { { @@ -2648,7 +2648,7 @@ Init_Rational(void) rb_define_method(rb_cRational, "fdiv", nurat_fdiv, 1); rb_define_method(rb_cRational, "**", nurat_expt, 1); - rb_define_method(rb_cRational, "<=>", nurat_cmp, 1); + rb_define_method(rb_cRational, "<=>", rb_rational_cmp, 1); rb_define_method(rb_cRational, "==", nurat_eqeq_p, 1); rb_define_method(rb_cRational, "coerce", nurat_coerce, 1); -- cgit v1.2.3