summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/string.c b/string.c
index edcb6aad78..6cef5ab157 100644
--- a/string.c
+++ b/string.c
@@ -3258,22 +3258,6 @@ rb_str_cmp(VALUE str1, VALUE str2)
return -1;
}
-/* expect tail call optimization */
-static VALUE
-str_eql(const VALUE str1, const VALUE str2)
-{
- const long len = RSTRING_LEN(str1);
- const char *ptr1, *ptr2;
-
- if (len != RSTRING_LEN(str2)) return Qfalse;
- if (!rb_str_comparable(str1, str2)) return Qfalse;
- if ((ptr1 = RSTRING_PTR(str1)) == (ptr2 = RSTRING_PTR(str2)))
- return Qtrue;
- if (memcmp(ptr1, ptr2, len) == 0)
- return Qtrue;
- return Qfalse;
-}
-
/*
* call-seq:
* str == obj -> true or false
@@ -3297,7 +3281,7 @@ rb_str_equal(VALUE str1, VALUE str2)
}
return rb_equal(str2, str1);
}
- return str_eql(str1, str2);
+ return rb_str_eql_internal(str1, str2);
}
/*
@@ -3312,7 +3296,7 @@ rb_str_eql(VALUE str1, VALUE str2)
{
if (str1 == str2) return Qtrue;
if (!RB_TYPE_P(str2, T_STRING)) return Qfalse;
- return str_eql(str1, str2);
+ return rb_str_eql_internal(str1, str2);
}
/*