Thread (2 messages) flat view 2 messages, 2 authors, 2026-01-14

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

From: Junio C Hamano <hidden>
Date: 2026-01-14 21:13:20

Taylor Blau [off-list ref] 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?
quoted hunk
Signed-off-by: Taylor Blau <redacted>
---
 midx-write.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/midx-write.c b/midx-write.c
index 13171d7e9c4..da9c5a7c295 100644
--- a/midx-write.c
+++ b/midx-write.c
@@ -637,7 +637,7 @@ static uint32_t *midx_pack_order(struct write_midx_context *ctx)
 		pack_order[i] = data[i].nr;
 	}
 	for (i = 0; i < ctx->nr; i++) {
-		struct pack_info *pack = &ctx->info[ctx->pack_perm[i]];
+		struct pack_info *pack = &ctx->info[i];
 		if (pack->bitmap_pos == BITMAP_POS_UNKNOWN)
 			pack->bitmap_pos = 0;
 	}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help