Skip to content

Commit a78a903

Browse files
ttaylorrgitster
authored andcommitted
get_size_by_pos(): convert to new revindex API
Remove another caller that holds onto a 'struct revindex_entry' by replacing the direct indexing with calls to 'pack_pos_to_offset()' and 'pack_pos_to_index()'. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cf98f2e commit a78a903

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pack-bitmap.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -835,11 +835,11 @@ static unsigned long get_size_by_pos(struct bitmap_index *bitmap_git,
835835
oi.sizep = &size;
836836

837837
if (pos < pack->num_objects) {
838-
struct revindex_entry *entry = &pack->revindex[pos];
839-
if (packed_object_info(the_repository, pack,
840-
entry->offset, &oi) < 0) {
838+
off_t ofs = pack_pos_to_offset(pack, pos);
839+
if (packed_object_info(the_repository, pack, ofs, &oi) < 0) {
841840
struct object_id oid;
842-
nth_packed_object_id(&oid, pack, entry->nr);
841+
nth_packed_object_id(&oid, pack,
842+
pack_pos_to_index(pack, pos));
843843
die(_("unable to get size of %s"), oid_to_hex(&oid));
844844
}
845845
} else {

0 commit comments

Comments
 (0)