`remain` no longer starts with 0

This commit is contained in:
Nobuyoshi Nakada 2022-08-25 13:47:47 +09:00
Родитель ffc6c5d056
Коммит 64c8ed272f
1 изменённых файлов: 2 добавлений и 7 удалений

Просмотреть файл

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