From bbc9eed034bb9fa7ee0ff1039ca8b9dbf1f92b50 Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 22 Mar 2002 07:26:42 +0000 Subject: * the VMS support patch submitted by Akiyoshi, Masamichi is merged. * eval.c (exec_under): changing ruby_class is OK, but should not alter cbase. * eval.c (yield_under_i): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- numeric.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'numeric.c') diff --git a/numeric.c b/numeric.c index 80fa1052f..39703fae3 100644 --- a/numeric.c +++ b/numeric.c @@ -944,6 +944,10 @@ static VALUE int_succ(num) VALUE num; { + if (FIXNUM_P(num)) { + long i = FIX2LONG(num) + 1; + return rb_int2inum(i); + } return rb_funcall(num, '+', 1, INT2FIX(1)); } @@ -1437,15 +1441,6 @@ fix_id2name(fix) return Qnil; } -static VALUE -fix_succ(fix) - VALUE fix; -{ - long i = FIX2LONG(fix) + 1; - - return rb_int2inum(i); -} - static VALUE fix_size(fix) VALUE fix; @@ -1709,8 +1704,6 @@ Init_Numeric() rb_define_method(rb_cFixnum, "to_f", fix_to_f, 0); - rb_define_method(rb_cFixnum, "succ", fix_succ, 0); - rb_define_method(rb_cFixnum, "next", fix_succ, 0); rb_define_method(rb_cFixnum, "size", fix_size, 0); rb_define_method(rb_cFixnum, "upto", fix_upto, 1); -- cgit