mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
rational.c: optimize Rational#==
* rational.c (nurat_eqeq_p): optimize Rational#==. Author: Tadashi Saito <tad.a.digger@gmail.com> * numeric.c (rb_int_equal): rename from int_equal and remove static to be exported. * internal.h (rb_int_equal): exported. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fb40c3776a
commit
d611a7c77b
3 changed files with 13 additions and 13 deletions
|
@ -3971,8 +3971,8 @@ fix_equal(VALUE x, VALUE y)
|
|||
}
|
||||
}
|
||||
|
||||
static VALUE
|
||||
int_equal(VALUE x, VALUE y)
|
||||
VALUE
|
||||
rb_int_equal(VALUE x, VALUE y)
|
||||
{
|
||||
if (FIXNUM_P(x)) {
|
||||
return fix_equal(x, y);
|
||||
|
@ -5255,8 +5255,8 @@ Init_Numeric(void)
|
|||
rb_define_method(rb_cInteger, "abs", int_abs, 0);
|
||||
rb_define_method(rb_cInteger, "magnitude", int_abs, 0);
|
||||
|
||||
rb_define_method(rb_cInteger, "===", int_equal, 1);
|
||||
rb_define_method(rb_cInteger, "==", int_equal, 1);
|
||||
rb_define_method(rb_cInteger, "===", rb_int_equal, 1);
|
||||
rb_define_method(rb_cInteger, "==", rb_int_equal, 1);
|
||||
rb_define_method(rb_cInteger, ">", int_gt, 1);
|
||||
rb_define_method(rb_cInteger, ">=", rb_int_ge, 1);
|
||||
rb_define_method(rb_cInteger, "<", int_lt, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue