From d5595a96272419a495e3766dc9c96b5884c00efd Mon Sep 17 00:00:00 2001 From: mrkn Date: Tue, 17 May 2016 15:08:33 +0000 Subject: Optimize enum_sum for a range from int to int * enum.c (enum_sum): Optimize for a range from int to int. * test/ruby/test_enum.rb (test_range_sum): Move from test_range.rb, and add assertions for some conditions. * test/ruby/test_enum.rb (test_hash_sum): Move from test_hash.rb. * test/ruby/test_hash.rb, test/ruby/test_range.rb: Remove test_sum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 0ebaa95ecb..c61f5d0982 100644 --- a/numeric.c +++ b/numeric.c @@ -3908,8 +3908,8 @@ fix_ge(VALUE x, VALUE y) } } -static VALUE -int_ge(VALUE x, VALUE y) +VALUE +rb_int_ge(VALUE x, VALUE y) { if (FIXNUM_P(x)) { return fix_ge(x, y); @@ -4950,7 +4950,7 @@ Init_Numeric(void) rb_define_method(rb_cInteger, "===", int_equal, 1); rb_define_method(rb_cInteger, "==", int_equal, 1); rb_define_method(rb_cInteger, ">", int_gt, 1); - rb_define_method(rb_cInteger, ">=", int_ge, 1); + rb_define_method(rb_cInteger, ">=", rb_int_ge, 1); rb_define_method(rb_cInteger, "<", int_lt, 1); rb_define_method(rb_cInteger, "<=", int_le, 1); -- cgit v1.2.3