Re: [PATCH RFC 01/24] ref-filter: get rid of goto
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 30, 2018, 20:49 UTC
- Message-ID
- <xmqqd11rt6ks.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <CAL21BmkOGE6UZQJTFQjq3qnmywwBJQOUXE7jSwP1_Vn6PZ8ezA@mail.gmail.com>
Оля Тележная <olyatelezhnaya@gmail.com> writes:
Show 18 quoted lines
>> one place improves readability. If better readability is the
>> purpose, I would even say
>>
>> for (i = 0; i < used_atom_cnt; i++) {
>> if (...)
>> - goto need_obj;
>> + break;
>> }
>> - return;
>> + if (used_atom_cnt <= i)
>> return;
>>
>> -need_obj:
>>
>> would make the result easier to follow with a much less impact.
>
> It's hard for me to read the code with goto, and as I know, it's not
> only my problem,...That sounds as if you are complaining "I wanted to get rid of goto and you tell me not to do so???", but read what I showed above again and notice that it is also getting rid of "goto".
The main difference from your version is that the original function is still kept as a single unit of work, instead of two.