Re: [PATCH v2 02/11] clean: do not pass strbuf by value
- From
Jeff King <peff@peff.net>
- Date
- Aug 2, 2025, 18:40 UTC
- Message-ID
- <20250802184044.GC1773585@coredump.intra.peff.net>
- In-Reply-To
- <xmqqtt2pisg0.fsf@gitster.g>
On Sat, Aug 02, 2025 at 09:44:47AM -0700, Junio C Hamano wrote:
Show 7 quoted lines
> > I dunno. Maybe it is nitpicking, but I think "don't take a strbuf if you > > only need a string" is a good general rule. Of course there is only one > > caller here, so flexibility is probably not that important. > > But I think we engrave both lessons in the history by keeping this > step as-is, do the string_list_split_in_place_f() thing, and then > add a new patch to pass just the .buf member to parse_choice().
I would certainly be happy with that.
The other strbuf-by-value in write_worktree_linking_files() could also just turn into a "const char *".
-Peff