Subject: Re: [PATCH v2 08/18] midx-write.c: don't use `pack_perm` when assigning `bitmap_pos`

From: Taylor Blau <[email-masked]>
Date: Wed, 14 Jan 2026 16:40:38 -0500

On Wed, Jan 14, 2026 at 01:13:17PM -0800, Junio C Hamano wrote:
> Taylor Blau <[email-masked]> writes:
>
> > But the process is completely unnecessary in the first place: we are
> > enumerating all values of `ctx->info`, and there is no reason to process
> > them in a different order than they appear in memory. Index `ctx->info`
> > directly to reflect that.
>
> As long as pack_perm[] is permutations of [0..ctx->nr-1], it does
> not matter, as we are clearing all the [0..ctx->nr-1] range anyway,
> in other words?

That's right. The contents of ctx->pack_perm here aren't so important
since it doesn't matter what order we consider the pack_info structs in.
As long as we see all of them we are OK, hence iterating over the
ctx->info array directly rather than in the permuted order given by
pack_perm.

Thanks,
Taylor