diff options
author | Nobuyoshi Nakada <[email protected]> | 2022-08-25 13:47:47 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2022-11-25 16:11:17 +0900 |
commit | 64c8ed272fea57e0825650f75e05eb44456a039a (patch) | |
tree | a158f60c41fe46af8b38718bbd2a11e97646d23a /enumerator.c | |
parent | ffc6c5d056e0f18a9bdfb9b1477d0192a6d37ea3 (diff) |
`remain` no longer starts with 0
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6809
Diffstat (limited to 'enumerator.c')
-rw-r--r-- | enumerator.c | 9 |
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; } |