]> git.ipfire.org Git - thirdparty/git.git/commitdiff
pack-bitmap-write: drop unused pack_idx_entry parameters
authorJeff King <peff@peff.net>
Sun, 28 Aug 2022 12:50:50 +0000 (08:50 -0400)
committerJunio C Hamano <gitster@pobox.com>
Sun, 28 Aug 2022 20:23:37 +0000 (13:23 -0700)
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 aa30162559 (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 93eb41e240
(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 <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pack-bitmap-write.c

index 2cfc92f287184541ccf9fe91c43c1ffbfbd2bd21..a213f5eddc5df2401f1232f37514050ea91efc31 100644 (file)
@@ -649,8 +649,6 @@ static const struct object_id *oid_access(size_t pos, const void *table)
 }
 
 static void write_selected_commits_v1(struct hashfile *f,
-                                     struct pack_idx_entry **index,
-                                     uint32_t index_nr,
                                      uint32_t *commit_positions,
                                      off_t *offsets)
 {
@@ -685,8 +683,6 @@ static int table_cmp(const void *_va, const void *_vb, void *_data)
 }
 
 static void write_lookup_table(struct hashfile *f,
-                              struct pack_idx_entry **index,
-                              uint32_t index_nr,
                               uint32_t *commit_positions,
                               off_t *offsets)
 {
@@ -808,10 +804,10 @@ void bitmap_writer_finish(struct pack_idx_entry **index,
                commit_positions[i] = commit_pos;
        }
 
-       write_selected_commits_v1(f, index, index_nr, commit_positions, offsets);
+       write_selected_commits_v1(f, commit_positions, offsets);
 
        if (options & BITMAP_OPT_LOOKUP_TABLE)
-               write_lookup_table(f, index, index_nr, commit_positions, offsets);
+               write_lookup_table(f, commit_positions, offsets);
 
        if (options & BITMAP_OPT_HASH_CACHE)
                write_hash_cache(f, index, index_nr);