Re: [PATCH v7 05/12] for-each-ref: introduce new structures for better organisation
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Jun 11, 2015, 17:56 UTC
- Message-ID
- <5579CBE0.3050301@gmail.com>
- In-Reply-To
- <vpqwpzarvl6.fsf@anie.imag.fr>
On 06/11/2015 11:11 PM, Matthieu Moy wrote:
Show 9 quoted lines
> Karthik Nayak <karthik.188@gmail.com> 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;
And this seemed like an overhead. If you still think I need to change the code to reflect the change early on I will gladly do a re-roll.
-- Regards, Karthik