Skip to content

Commit 125ee4a

Browse files
ttaylorrgitster
authored andcommitted
pack-bitmap: drop redundant args from bitmap_writer_build_type_index()
The previous commit ensures that the bitmap_writer's "to_pack" field is initialized early on, so the "to_pack" and "index_nr" arguments to `bitmap_writer_build_type_index()` are redundant. Drop them and adjust the callers accordingly. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 01e9d12 commit 125ee4a

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

builtin/pack-objects.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ static void write_pack_file(void)
13451345
the_repository, &to_pack);
13461346
bitmap_writer_set_checksum(&bitmap_writer, hash);
13471347
bitmap_writer_build_type_index(&bitmap_writer,
1348-
&to_pack, written_list, nr_written);
1348+
written_list);
13491349
}
13501350

13511351
if (cruft)

midx-write.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,8 +827,7 @@ static int write_midx_bitmap(const char *midx_name,
827827

828828
bitmap_writer_init(&writer, the_repository, pdata);
829829
bitmap_writer_show_progress(&writer, flags & MIDX_PROGRESS);
830-
bitmap_writer_build_type_index(&writer, pdata, index,
831-
pdata->nr_objects);
830+
bitmap_writer_build_type_index(&writer, index);
832831

833832
/*
834833
* bitmap_writer_finish expects objects in lex order, but pack_order

pack-bitmap-write.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,21 @@ void bitmap_writer_show_progress(struct bitmap_writer *writer, int show)
101101
* Build the initial type index for the packfile or multi-pack-index
102102
*/
103103
void bitmap_writer_build_type_index(struct bitmap_writer *writer,
104-
struct packing_data *to_pack,
105-
struct pack_idx_entry **index,
106-
uint32_t index_nr)
104+
struct pack_idx_entry **index)
107105
{
108106
uint32_t i;
109107

110108
writer->commits = ewah_new();
111109
writer->trees = ewah_new();
112110
writer->blobs = ewah_new();
113111
writer->tags = ewah_new();
114-
ALLOC_ARRAY(to_pack->in_pack_pos, to_pack->nr_objects);
112+
ALLOC_ARRAY(writer->to_pack->in_pack_pos, writer->to_pack->nr_objects);
115113

116-
for (i = 0; i < index_nr; ++i) {
114+
for (i = 0; i < writer->to_pack->nr_objects; ++i) {
117115
struct object_entry *entry = (struct object_entry *)index[i];
118116
enum object_type real_type;
119117

120-
oe_set_in_pack_pos(to_pack, entry, i);
118+
oe_set_in_pack_pos(writer->to_pack, entry, i);
121119

122120
switch (oe_type(entry)) {
123121
case OBJ_COMMIT:
@@ -128,7 +126,7 @@ void bitmap_writer_build_type_index(struct bitmap_writer *writer,
128126
break;
129127

130128
default:
131-
real_type = oid_object_info(to_pack->repo,
129+
real_type = oid_object_info(writer->to_pack->repo,
132130
&entry->idx.oid, NULL);
133131
break;
134132
}

pack-bitmap.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ void bitmap_writer_show_progress(struct bitmap_writer *writer, int show);
129129
void bitmap_writer_set_checksum(struct bitmap_writer *writer,
130130
const unsigned char *sha1);
131131
void bitmap_writer_build_type_index(struct bitmap_writer *writer,
132-
struct packing_data *to_pack,
133-
struct pack_idx_entry **index,
134-
uint32_t index_nr);
132+
struct pack_idx_entry **index);
135133
int bitmap_writer_has_bitmapped_object_id(struct bitmap_writer *writer,
136134
const struct object_id *oid);
137135
void bitmap_writer_push_commit(struct bitmap_writer *writer,

0 commit comments

Comments
 (0)