summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/string.c b/string.c
index 017617aaf1..3d4fd37b5a 100644
--- a/string.c
+++ b/string.c
@@ -2389,13 +2389,8 @@ rb_str_cmp_m(VALUE str1, VALUE str2)
if (RB_TYPE_P(tmp, T_STRING)) {
result = rb_str_cmp(str1, tmp);
}
- else if ((tmp = rb_check_funcall(str2, rb_intern("<=>"), 1, &str1)) ==
- Qundef) {
- return Qnil;
- }
else {
- if (NIL_P(tmp)) return Qnil;
- result = -rb_cmpint(tmp, str1, str2);
+ return rb_invcmp(str1, str2);
}
}
else {