Skip to content

Commit 969a564

Browse files
peffgitster
authored andcommitted
pack-bitmap-write: drop unused pack_idx_entry parameters
Our write_selected_commits_v1() function takes an array of pack_idx_entry structs. We used to need them for computing commit positions, but since aa30162 (bitmap: move `get commit positions` code to `bitmap_writer_finish`, 2022-08-14), the caller passes in a separate array of positions for us. We can drop the unused array (and its matching length parameter). Likewise, when we added write_lookup_table() in 93eb41e (pack-bitmap-write.c: write lookup table extension, 2022-08-14), it receives the same array of positions. So its "index" parameter was never used at all. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 761416e commit 969a564

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pack-bitmap-write.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,6 @@ static const struct object_id *oid_access(size_t pos, const void *table)
649649
}
650650

651651
static void write_selected_commits_v1(struct hashfile *f,
652-
struct pack_idx_entry **index,
653-
uint32_t index_nr,
654652
uint32_t *commit_positions,
655653
off_t *offsets)
656654
{
@@ -685,8 +683,6 @@ static int table_cmp(const void *_va, const void *_vb, void *_data)
685683
}
686684

687685
static void write_lookup_table(struct hashfile *f,
688-
struct pack_idx_entry **index,
689-
uint32_t index_nr,
690686
uint32_t *commit_positions,
691687
off_t *offsets)
692688
{
@@ -808,10 +804,10 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
808804
commit_positions[i] = commit_pos;
809805
}
810806

811-
write_selected_commits_v1(f, index, index_nr, commit_positions, offsets);
807+
write_selected_commits_v1(f, commit_positions, offsets);
812808

813809
if (options & BITMAP_OPT_LOOKUP_TABLE)
814-
write_lookup_table(f, index, index_nr, commit_positions, offsets);
810+
write_lookup_table(f, commit_positions, offsets);
815811

816812
if (options & BITMAP_OPT_HASH_CACHE)
817813
write_hash_cache(f, index, index_nr);

0 commit comments

Comments
 (0)