summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-08-24 06:36:14 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-08-24 06:36:14 +0000
commit150daae136b0b0e9aa3b687e30988d9e295c42f5 (patch)
tree26ac797c60d92af46bd3257dedabb40b8ab509e9 /numeric.c
parent422b6dc8dd49146b15ac9335e57e33a7aeb1462f (diff)
* array.c (rb_ary_equal): check identiry equality first.
* string.c (rb_str_equal): ditto. * struct.c (rb_struct_equal): ditto. * numeric.c (Init_Numeric): undef Integer::new. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/numeric.c b/numeric.c
index 40e607b222..a60cb6c364 100644
--- a/numeric.c
+++ b/numeric.c
@@ -1125,7 +1125,7 @@ fix_equal(x, y)
VALUE x, y;
{
if (FIXNUM_P(y)) {
- return (FIX2LONG(x) == FIX2LONG(y))?Qtrue:Qfalse;
+ return (x == y)?Qtrue:Qfalse;
}
else {
return num_equal(x, y);
@@ -1556,6 +1556,8 @@ Init_Numeric()
rb_define_method(rb_cNumeric, "truncate", num_truncate, 0);
rb_cInteger = rb_define_class("Integer", rb_cNumeric);
+ rb_undef_method(CLASS_OF(rb_cInteger), "new");
+
rb_define_method(rb_cInteger, "integer?", int_int_p, 0);
rb_define_method(rb_cInteger, "upto", int_upto, 1);
rb_define_method(rb_cInteger, "downto", int_downto, 1);
@@ -1577,8 +1579,6 @@ Init_Numeric()
rb_define_singleton_method(rb_cFixnum, "induced_from", rb_fix_induced_from, 1);
rb_define_singleton_method(rb_cInteger, "induced_from", rb_int_induced_from, 1);
- rb_undef_method(CLASS_OF(rb_cFixnum), "new");
-
rb_define_method(rb_cFixnum, "to_s", fix_to_s, 0);
rb_define_method(rb_cFixnum, "type", fix_type, 0);