summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'array.c')
-rw-r--r--array.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/array.c b/array.c
index 6b551dbe24..4775472221 100644
--- a/array.c
+++ b/array.c
@@ -3846,9 +3846,15 @@ VALUE
rb_ary_includes(VALUE ary, VALUE item)
{
long i;
+ VALUE e;
for (i=0; i<RARRAY_LEN(ary); i++) {
- if (rb_equal(RARRAY_AREF(ary, i), item)) {
+ e = RARRAY_AREF(ary, i);
+ switch (rb_equal_opt(e, item)) {
+ case Qundef:
+ if (rb_equal(e, item)) return Qtrue;
+ break;
+ case Qtrue:
return Qtrue;
}
}