Re: [PATCH v4 04/16] ref-filter: add `ref_filter_clear()`
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jul 3, 2023, 17:13 UTC
- Message-ID
- <ZKMBxnQo1MyB7s9e@nand.local>
- In-Reply-To
- <20230703051946.GD3502534@coredump.intra.peff.net>
On Mon, Jul 03, 2023 at 01:19:46AM -0400, Jeff King wrote:
Show 9 quoted lines
> > +void ref_filter_init(struct ref_filter *filter)
> > +{
> > + struct ref_filter blank = REF_FILTER_INIT;
> > + memcpy(filter, &blank, sizeof(blank));
> > +}
>
> I was a little surprised by adding init() here, but we need it at the
> end of clear(). So this is an OK place for it (the other option would be
> in the earlier INIT patch, but it would be unused until now).I used to write more patches in this style where I would add as much of a new API as possible as early as possible in the series. But I think reviewers seem to have an easier time reviewing API additions in the same patch that adds their caller.
So I tend to agree that this patch is probably a good spot to introduce `ref_filter_init()`. But if you feel strongly, I'm happy to drag it around.
Thanks, Taylor