Skip to content

Commit cf98f2e

Browse files
ttaylorrgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5766508 commit cf98f2e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pack-bitmap.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,21 +711,22 @@ static void show_objects_for_type(
711711

712712
for (offset = 0; offset < BITS_IN_EWORD; ++offset) {
713713
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;
716716

717717
if ((word >> offset) == 0)
718718
break;
719719

720720
offset += ewah_bit_ctz64(word >> offset);
721721

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);
724725

725726
if (bitmap_git->hashes)
726-
hash = get_be32(bitmap_git->hashes + entry->nr);
727+
hash = get_be32(bitmap_git->hashes + index_pos);
727728

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);
729730
}
730731
}
731732
}

0 commit comments

Comments
 (0)