summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/enum.c b/enum.c
index 968250c326..5beb900d4f 100644
--- a/enum.c
+++ b/enum.c
@@ -1435,7 +1435,7 @@ enum_take(VALUE obj, VALUE n)
static VALUE
take_while_i(VALUE i, VALUE *ary)
{
- if (!rb_yield(i)) rb_iter_break();
+ if (!RTEST(rb_yield(i))) rb_iter_break();
rb_ary_push(*ary, i);
return Qnil;
}
@@ -1501,7 +1501,7 @@ enum_drop(VALUE obj, VALUE n)
static VALUE
drop_while_i(VALUE i, VALUE *args)
{
- if (!args[1] && !rb_yield(i)) {
+ if (!args[1] && !RTEST(rb_yield(i))) {
args[1] = Qtrue;
}
if (args[1]) {