pack-revindex.c: avoid direct revindex access in 'offset_to_pack_pos()'
authorTaylor Blau <redacted>
Wed, 13 Jan 2021 22:25:10 +0000 (17:25 -0500)
committerJunio C Hamano <redacted>
Thu, 14 Jan 2021 05:53:48 +0000 (21:53 -0800)
commite5dcd7841828fd4c03dfc8a5c52691ada979b7e2
tree843c88476e50896f179d590fdff70ccd6c2ef9f0
parentd5bc7c60c72ee239b5c5d3e4aa808d29412f78d8
pack-revindex.c: avoid direct revindex access in 'offset_to_pack_pos()'

To prepare for on-disk reverse indexes, remove a spot in
'offset_to_pack_pos()' that looks at the 'revindex' array in 'struct
packed_git'.

Even though this use of the revindex pointer is within pack-revindex.c,
this clean up is still worth doing. Since the 'revindex' pointer will be
NULL when reading from an on-disk reverse index (instead the
'revindex_data' pointer will be mmaped to the 'pack-*.rev' file), this
call-site would have to include a conditional to lookup the offset for
position 'mi' each iteration through the search.

So instead of open-coding 'pack_pos_to_offset()', call it directly from
within 'offset_to_pack_pos()'.

Signed-off-by: Taylor Blau <redacted>
Signed-off-by: Junio C Hamano <redacted>
pack-revindex.c
git clone https://git.99rst.org/PROJECT