From: Jeff King Date: Sat, 22 Apr 2023 11:14:33 GMT Subject: Re: [PATCH v2 2/6] string-list: introduce `string_list_setlen()` Message-ID: <20230422111433.GC2969939@coredump.intra.peff.net> In-Reply-To: <2a20ad8bc5513aae912c53a294092ee5087e1873.1681845518.git.me@ttaylorr.com> On Tue, Apr 18, 2023 at 03:18:46PM -0400, Taylor Blau wrote: > This allows `string_list_split_in_place()` to overwrite any existing > entries without needing to free and re-allocate them. > > However, setting `list->nr` manually is not safe in all instances. There > are a couple of cases worth worrying about: > [...] Thanks for adding this patch. Your explanation very nicely covers why this is a reasonable pattern, and what pitfalls we're worried about by doing it inline. > Co-authored-by: Jeff King > Signed-off-by: Jeff King Acking my forged sign-off. :) -Peff