From: Taylor Blau Date: Tue, 09 Dec 2025 02:14:43 GMT Subject: Re: [PATCH 13/17] midx-write.c: enumerate `pack_int_id` values directly Message-ID: In-Reply-To: On Mon, Dec 08, 2025 at 07:27:08PM +0100, Patrick Steinhardt wrote: > On Sat, Dec 06, 2025 at 03:31:37PM -0500, Taylor Blau wrote: > > Our `midx-write.c::fill_packs_from_midx()` function currently enumerates > > the range [0, m->num_packs), and then shifts its index variable up by > > `m->num_packs_in_base` to produce a valid `pack_int_id`. > > > > Instead, directly enumerate the range: > > > > [m->num_packs_in_base, m->num_packs_in_base + m->num_packs) > > > > , which are the original pack_int_ids themselves as opposed to the > > indexes of those packs relative to the MIDX layer they are contained > > within. > > Sensible. I was confused a bit by the previous change because I couldn't > quite spot the shift happening. I think this makes things a bit easier > to read. I'm glad that the end result was more pleasing. I have gone back and forth whether to enumerate [0, m->num_packs) and shift, or to enumerate the pack_int_ids directly, so it's helpful to know what style others prefer. Thanks, Taylor