From aa1ea534ced1699c4bc7f91a6ba8b11338152b28 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 3 Feb 2003 08:45:26 +0000 Subject: * object.c (Init_Object): default Object#=== now calls "==" internally. * re.c (rb_reg_initialize_m): should honor option status of original regexp. * array.c (rb_ary_equal): ary2 should be T_ARRAY (no to_ary conversion). * array.c (rb_ary_eql): ditto. * string.c (rb_str_equal): str2 should be T_STRING (no to_str conversion). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index 90449023c..1b7c2152f 100644 --- a/string.c +++ b/string.c @@ -773,13 +773,9 @@ rb_str_equal(str1, str2) VALUE str1, str2; { if (str1 == str2) return Qtrue; - if (TYPE(str2) != T_STRING) { - str2 = rb_check_string_type(str2); - if (NIL_P(str2)) return Qfalse; - } - - if (RSTRING(str1)->len == RSTRING(str2)->len - && rb_str_cmp(str1, str2) == 0) { + if (TYPE(str2) != T_STRING) return Qfalse; + if (RSTRING(str1)->len == RSTRING(str2)->len && + rb_str_cmp(str1, str2) == 0) { return Qtrue; } return Qfalse; @@ -3194,7 +3190,6 @@ Init_String() rb_define_method(rb_cString, "copy_object", rb_str_replace, 1); rb_define_method(rb_cString, "<=>", rb_str_cmp_m, 1); rb_define_method(rb_cString, "==", rb_str_equal, 1); - rb_define_method(rb_cString, "===", rb_str_equal, 1); rb_define_method(rb_cString, "eql?", rb_str_eql, 1); rb_define_method(rb_cString, "hash", rb_str_hash_m, 0); rb_define_method(rb_cString, "casecmp", rb_str_casecmp, 1); -- cgit