pack-objects: convert packlist_find() to use object_id
We take a raw hash pointer, but most of our callers have a "struct object_id" already. Let's switch to taking the full struct, which will let us continue removing uses of raw sha1 buffers. There are two callers that do need special attention: - in rebuild_existing_bitmaps(), we need to switch to nth_packed_object_oid(). This incurs an extra hash copy over pointing straight to the mmap'd sha1, but it shouldn't be measurable compared to the rest of the operation. - in can_reuse_delta() we already spent the effort to copy the sha1 into a "struct object_id", but now we just have to do so a little earlier in the function (we can't easily convert that function's callers because they may be pointing at mmap'd REF_DELTA blocks). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
05805d7411
commit
3df28caefb
@ -144,7 +144,7 @@ static inline void reset_all_seen(void)
|
||||
|
||||
static uint32_t find_object_pos(const struct object_id *oid)
|
||||
{
|
||||
struct object_entry *entry = packlist_find(writer.to_pack, oid->hash, NULL);
|
||||
struct object_entry *entry = packlist_find(writer.to_pack, oid, NULL);
|
||||
|
||||
if (!entry) {
|
||||
die("Failed to write bitmap index. Packfile doesn't have full closure "
|
||||
|
Reference in New Issue
Block a user