Re: [PATCH v4 6/8] branch.c: use 'ref-filter' data structures

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 13, 2015 at 5:56 PM, Matthieu Moy
<Matthieu.Moy@xxxxxxxxxxxxxxx> wrote:
> Karthik Nayak <karthik.188@xxxxxxxxx> writes:
>
>>       /* Print detached HEAD before sorting and printing the rest */
>> -     if (detached) {
>> -             print_ref_item(&ref_list.list[index - 1], maxwidth, verbose, abbrev,
>> -                            detached, remote_prefix);
>> -             index -= 1;
>> +     if (filter->kind & FILTER_REFS_DETACHED_HEAD) {
>> +             print_ref_item(array.items[array.nr - 1], maxwidth, filter, remote_prefix);
>> +             free_array_item(array.items[array.nr - 1]);
>> +             array.nr--;
>
> Ah, this answers my previous remark: indeed, you are removing the
> element from the array completely after this patch. You may want to
> modify the previous patch to start doing it earlier, but I think it's
> not worth the trouble: I agree with the final state, only the
> intermediate state is suboptimal (but still acceptable to me at least).
>

Yes! Eric suggested this. It doesn't make much sense in the previous
patch, cause I'd have to introduce something along the lines of
free_array_item() only to be removed/replaced here.

-- 
Regards,
Karthik Nayak
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]