Re: [PATCH v2 2/4] worktree: link worktrees with relative paths

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

 



On Sunday, October 6th, 2024 at 22:45, shejialuo <shejialuo@xxxxxxxxx> wrote:
> You don't need to create a new "strbuf" for each of the paths. You could
> just use "strbuf_reset" for only one "struct strbuf".
> 

> struct strbuf file = STRBUF_INIT;
> 

> if (...) {
> strbuf_addf(...);
> strbuf_reset(&file);
> strbuf_addf(...);
> 

> }
> 

> strbuf_release(&file);

Ah, this is a better design---I've updated this to use a single strbuf, thanks!

Attachment: signature.asc
Description: OpenPGP digital signature


[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