summaryrefslogtreecommitdiff
path: root/compar.c
diff options
context:
space:
mode:
Diffstat (limited to 'compar.c')
-rw-r--r--compar.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/compar.c b/compar.c
index eea76cb637..2f4db291a4 100644
--- a/compar.c
+++ b/compar.c
@@ -52,9 +52,16 @@ rb_invcmp(VALUE x, VALUE y)
}
static VALUE
+cmp_eq_recursive(VALUE arg1, VALUE arg2, int recursive)
+{
+ if (recursive) return Qfalse;
+ return rb_funcallv(arg1, cmp, 1, &arg2);
+}
+
+static VALUE
cmp_eq(VALUE *a)
{
- VALUE c = rb_funcall(a[0], cmp, 1, a[1]);
+ VALUE c = rb_exec_recursive_paired_outer(cmp_eq_recursive, a[0], a[1], a[1]);
if (NIL_P(c)) return Qfalse;
if (rb_cmpint(c, a[0], a[1]) == 0) return Qtrue;