Re: [PATCH v2 08/18] midx-write.c: don't use `pack_perm` when assigning `bitmap_pos`
- From
Taylor Blau <me@ttaylorr.com>
- Date
- Jan 14, 2026, 21:40 UTC
- Message-ID
- <aWgNVjCej8wO85iD@nand.local>
- In-Reply-To
- <xmqq4iongaoi.fsf@gitster.g>
On Wed, Jan 14, 2026 at 01:13:17PM -0800, Junio C Hamano wrote:
Show 10 quoted lines
> Taylor Blau <me@ttaylorr.com> 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