remain no longer starts with 0

This commit is contained in:
Nobuyoshi Nakada 2022-08-25 13:47:47 +09:00
parent ffc6c5d056
commit 64c8ed272f
Notes: git 2022-11-25 07:11:40 +00:00

View File

@ -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;
}