Re: [PATCH 08/11] midx-write.c: avoid directly managed temporary strbuf

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

 



On Mon, Mar 25, 2024 at 01:33:11PM -0700, Junio C Hamano wrote:
> Taylor Blau <me@xxxxxxxxxxxx> writes:
>
> > In midx-write.c::midx_repack(), we construct the command-line arguments
> > for a pack-objects invocation which will combine objects from the packs
> > below our `--batch-size` option.
> >
> > To construct the base name of the output pack, we use a temporary
> > strbuf, and then push the result of that onto the strvec which holds the
> > command-line arguments, after which point we release the strbuf.
> >
> > We could replace this by doing something like:
> >
> >     struct strbuf buf = STRBUF_INIT;
> >     strbuf_addf(&buf, "%s/pack/pack", object_dir);
> >     strvec_push_nodup(&cmd.args, strbuf_detach(&buf));
>
> Hmph, I thought I saw another patch recently that uses
> strvec_pushf() to simplify such a sequence.  Does the technique
> apply here as well?
>
> Ah, yes, exactly.  See <9483038c-9529-4243-9b9a-97254fac29c1@xxxxxx>

Hah. I wrote this patch on Saturday but didn't read the list before
sending it on Monday. Serves me right ;-). Feel free to drop this one,
or I can reroll based on René's patch.

Either is fine, just let me know :-).

Thanks,
Taylor




[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]

  Powered by Linux