From 64c8ed272fea57e0825650f75e05eb44456a039a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 25 Aug 2022 13:47:47 +0900 Subject: [PATCH] `remain` no longer starts with 0 --- enumerator.c | 9 ++------- 1 file 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; }