Skip to content

Commit c409d10

Browse files
peffgitster
authored andcommitted
pack-objects: drop unused parameter from oe_map_new_pack()
Since 43fa44f (pack-objects: move in_pack out of struct object_entry, 2018-04-14), we store the source pack for each object as a small index rather than as a pointer. When we see a new pack that has no allocated index, we fall back to generating an array of pointers by calling oe_map_new_pack(). Perhaps counter-intuitively, that function does not need to actually see our new index-less pack. It only allocates and populates the array with the existing packs, after which oe_set_in_pack() actually adds the new pack to the array. Let's drop the unused "struct packed_git" argument to oe_map_new_pack() to avoid confusion. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b53c502 commit c409d10

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

pack-objects.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ static void prepare_in_pack_by_idx(struct packing_data *pdata)
119119
* this fall back code, just stay simple and fall back to using
120120
* in_pack[] array.
121121
*/
122-
void oe_map_new_pack(struct packing_data *pack,
123-
struct packed_git *p)
122+
void oe_map_new_pack(struct packing_data *pack)
124123
{
125124
uint32_t i;
126125

pack-objects.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,14 +247,14 @@ static inline struct packed_git *oe_in_pack(const struct packing_data *pack,
247247
return pack->in_pack[e - pack->objects];
248248
}
249249

250-
void oe_map_new_pack(struct packing_data *pack,
251-
struct packed_git *p);
250+
void oe_map_new_pack(struct packing_data *pack);
251+
252252
static inline void oe_set_in_pack(struct packing_data *pack,
253253
struct object_entry *e,
254254
struct packed_git *p)
255255
{
256256
if (!p->index)
257-
oe_map_new_pack(pack, p);
257+
oe_map_new_pack(pack);
258258
if (pack->in_pack_by_idx)
259259
e->in_pack_idx = p->index;
260260
else

0 commit comments

Comments
 (0)