Re: [PATCH v3 02/11] reftable: pass opts as constant pointer
- From
Patrick Steinhardt <ps@pks.im>
- Date
- May 22, 2024, 07:19 UTC
- Message-ID
- <Zk2cdW5r1Hv6bCj5@tanuki>
- In-Reply-To
- <emcnb7fqqihc6mdjusk7wp7fr5zoxllpectcbtbhazbay273j3@us352qejrtnr>
On Tue, May 21, 2024 at 06:22:43PM -0500, Justin Tobler wrote:
Show 21 quoted lines
> On 24/05/13 10:17AM, Patrick Steinhardt wrote: > > We sometimes pass the refatble write options as value and sometimes as a > > s/refatble/reftable > > > pointer. This is quite confusing and makes the reader wonder whether the > > options get modified sometimes. > > > > In fact, `reftable_new_writer()` does cause the caller-provided options > > to get updated when some values aren't set up. This is quite unexpected, > > but didn't cause any harm until now. > > > > Adapt the code so that we do not modify the caller-provided values > > anymore. While at it, refactor the code to code to consistently pass the > > options as a constant pointer to clarify that the caller-provided opts > > will not ever get modified. > > Doesn't really matter, but would it be more accurate to say "pointer to > a constant type"? > > Overall, I like this change. Improves consistency and readability :)
True. As you mentioned, I'll not reroll this series just for these two small issues though.
Patrick