Re: [PATCH v2 03/11] reftable/writer: drop static variable used to initialize strbuf
- From
Junio C Hamano <gitster@pobox.com>
- Date
- May 10, 2024, 21:19 UTC
- Message-ID
- <xmqqttj52wma.fsf@gitster.g>
- In-Reply-To
- <aa2903e3e5ac76f82252e12919a8a09178e267ee.1715336798.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> We have a static variable in the reftable writer code that is merely > used to initialize the `last_key` of the writer. Convert the code to > instead use `strbuf_init()` and drop the variable.
Nice. There is no guarantee that a structure assignment of a just-initialized empty strbuf to another will stay to be a trouble free operation, and using an explicit _init() call is the right thing to do.