Re: [PATCH v7 05/12] for-each-ref: introduce new structures for better organisation

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

 



On 06/12/2015 12:43 AM, Matthieu Moy wrote:
Karthik Nayak <karthik.188@xxxxxxxxx> writes:

> On 06/11/2015 11:11 PM, Matthieu Moy wrote:
>> Karthik Nayak <karthik.188@xxxxxxxxx> writes:
>>
>>> +struct ref_filter_cbdata {
>>> +    struct ref_array array;
>>> +    struct ref_filter filter;
>>> +};
>>
>> I didn't notice this at first, but why introduce the structure like this
>> when you are going to turn it into pointers later in PATCH 7:
> Here it is serving to for-each-ref, so I kept it this way so as to ensure
> that currently as per this patch
>
> struct ref_filter_cbdata ref_cbdata;
>
> would be the only declaration needed in for-each-ref.c
> If I made them pointers here I would need to have
>
> struct ref_filter_cbdata ref_cbdata;
> struct ref_filter filter;
> struct ref_array array;
> ref_cbdata.filter = &filter;
> ref_cbdata.array = &array;

... but after PATCH 7, filter and array are passed to ref_filter so you
don't have this overhead anyway. Makes sense.

Yes, there we wouldn't have a ref_cbdata in 'for-each-ref'.
But this would be taken care of in 'filter_refs()'.
"Makes sense." Not sure if you're agreeing with me or you want me to re-roll.

--
Regards,
Karthik
--
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]