summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-03 08:45:26 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-02-03 08:45:26 +0000
commit467035750e83a2d532bd8c2c5fb9fd78c1810132 (patch)
tree99b881e01316af946a2dfa978b0067aae9675f6b /string.c
parent056585d6dc58c4b9b1e4bf5e58c0bc81b5122fc6 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@3435 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/string.c b/string.c
index 90449023c6..1b7c2152f5 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);