show_objects_for_type(): convert to new revindex API

Avoid storing the revindex entry directly, since this structure will soon be removed from the public interface. Instead, store the offset and index position by calling 'pack_pos_to_offset()' and 'pack_pos_to_index()', respectively. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Taylor Blau committed Jan 13, 2021 at 17:23 UTC cf98f2e8e09416b72bf984af4706c140de8794ab
1 file changed +7 -6
pack-bitmap.c
+7 -6
@@ -711,21 +711,22 @@ static void show_objects_for_type(
711
712 for (offset = 0; offset < BITS_IN_EWORD; ++offset) {
713 struct object_id oid;
714 - struct revindex_entry *entry;
715 - uint32_t hash = 0;
714 + uint32_t hash = 0, index_pos;
715 + off_t ofs;
716
717 if ((word >> offset) == 0)
718 break;
719
720 offset += ewah_bit_ctz64(word >> offset);
721
722 - entry = &bitmap_git->pack->revindex[pos + offset];
723 - nth_packed_object_id(&oid, bitmap_git->pack, entry->nr);
722 + index_pos = pack_pos_to_index(bitmap_git->pack, pos + offset);
723 + ofs = pack_pos_to_offset(bitmap_git->pack, pos + offset);
724 + nth_packed_object_id(&oid, bitmap_git->pack, index_pos);
725
726 if (bitmap_git->hashes)
726 - hash = get_be32(bitmap_git->hashes + entry->nr);
727 + hash = get_be32(bitmap_git->hashes + index_pos);
728
728 - show_reach(&oid, object_type, 0, hash, bitmap_git->pack, entry->offset);
729 + show_reach(&oid, object_type, 0, hash, bitmap_git->pack, ofs);
730 }
731 }
732 }