pack-objects: drop unused parameter from oe_map_new_pack()
authorJeff King <peff@peff.net>
Thu, 14 Feb 2019 05:50:32 +0000 (00:50 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Feb 2019 23:26:15 +0000 (15:26 -0800)
Since 43fa44fa3b (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>
pack-objects.c
pack-objects.h
index e7cd337bee53cb02282a14c8aa88f2342edd2eb2..ce33b8906e5c589813c7d873c9173aa3aa2afddc 100644 (file)
@@ -119,8 +119,7 @@ static void prepare_in_pack_by_idx(struct packing_data *pdata)
  * this fall back code, just stay simple and fall back to using
  * in_pack[] array.
  */
-void oe_map_new_pack(struct packing_data *pack,
-                    struct packed_git *p)
+void oe_map_new_pack(struct packing_data *pack)
 {
        uint32_t i;
 
index 6bfacc7d2cedd7f399d7807b7746b6ed66737eed..6fde7ce27cbc15b33a3d994bad87ab140f3164a7 100644 (file)
@@ -247,14 +247,14 @@ static inline struct packed_git *oe_in_pack(const struct packing_data *pack,
                return pack->in_pack[e - pack->objects];
 }
 
-void oe_map_new_pack(struct packing_data *pack,
-                    struct packed_git *p);
+void oe_map_new_pack(struct packing_data *pack);
+
 static inline void oe_set_in_pack(struct packing_data *pack,
                                  struct object_entry *e,
                                  struct packed_git *p)
 {
        if (!p->index)
-               oe_map_new_pack(pack, p);
+               oe_map_new_pack(pack);
        if (pack->in_pack_by_idx)
                e->in_pack_idx = p->index;
        else