Re: [PATCH v10 5/9] ls-tree: optimize naming and handling of "return" in show_tree()
On Fri, Jan 14 2022, Teng Long wrote:
Show 17 quoted lines
> On Thu, Jan 13, 2022 at 2:55 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>
>> Re the $subject: Is "optimize naming" here just referring to the
>> s/retval/recurse/g?
>
> Yes.
>
>> Personally I think just a s/retval/ret/g here would make more senes if
>> we're doing any change at all, and in either case having this variable
>> re-rename split up as its own commit would make the proposed control
>> flow changes clearer.
>
> Do you mean that I can split the current one into two commits, one does
> the renaming work and another one does the left work?
>
> If so, I will do this in the next patch.
Yes, at least I would find it easier to read :)
Show 11 quoted lines
>>
>> This new function is a re-invention of the object_type() utility in
>> cache.h, and isn't needed. I.e....
>>
>> ...just drop it and do this:
>>
>> - enum object_type type = get_type(mode);
>> + enum object_type type = object_type(mode);
>
> You are absolutely correct.
> I will replace get_type() to object_type() in the next patch.