summaryrefslogtreecommitdiff
path: root/enumerator.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-08-25 13:47:47 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-11-25 16:11:17 +0900
commit64c8ed272fea57e0825650f75e05eb44456a039a (patch)
treea158f60c41fe46af8b38718bbd2a11e97646d23a /enumerator.c
parentffc6c5d056e0f18a9bdfb9b1477d0192a6d37ea3 (diff)
downloadruby-64c8ed272fea57e0825650f75e05eb44456a039a.tar.gz
`remain` no longer starts with 0
Diffstat (limited to 'enumerator.c')
-rw-r--r--enumerator.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/enumerator.c b/enumerator.c
index a88ae1becf..4d2d73240e 100644
--- a/enumerator.c
+++ b/enumerator.c
@@ -2447,13 +2447,8 @@ lazy_take_proc(VALUE proc_entry, struct MEMO *result, VALUE memos, long memo_ind
}
remain = NUM2LONG(memo);
- if (remain == 0) {
- LAZY_MEMO_SET_BREAK(result);
- }
- else {
- if (--remain == 0) LAZY_MEMO_SET_BREAK(result);
- rb_ary_store(memos, memo_index, LONG2NUM(remain));
- }
+ if (--remain == 0) LAZY_MEMO_SET_BREAK(result);
+ rb_ary_store(memos, memo_index, LONG2NUM(remain));
return result;
}