Re: [PATCH 2/8] midx-write.c: reduce argument count for `get_sorted_entries()`
- From
Taylor Blau <me@ttaylorr.com>
- Date
- May 29, 2024, 22:35 UTC
- Message-ID
- <Zletr6Q7QBgQ0CgQ@nand.local>
- In-Reply-To
- <ZlbdrczSqKgueK0g@tanuki>
On Wed, May 29, 2024 at 09:47:57AM +0200, Patrick Steinhardt wrote:
Show 6 quoted lines
> Nit: I think it's a bit surprising that a getter function would modify > the passed in structure. It's also a bit puzzling that we assign > `entries_nr` in here, but rely on the caller to set the corresponding > `entries` field. I think we should either have the caller assign both > fields, or we should rename the function and assign both of these fields > in the function.
Thanks, I agree and should have changed the name of this function in the existing round.
I renamed it to "compute_sorted_entries()" which takes only a single "struct write_midx_context *", and assigns both "ctx->entries" and "ctx->entries_nr".
Thanks, Taylor