summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2023-12-14 17:24:28 -0500
committerJunio C Hamano <gitster@pobox.com>2023-12-14 14:38:08 -0800
commite1bfe30c4dd29a1a30569d04432d73675e497e86 (patch)
treec53dc9d441a7721ba71c61aecd07d2dd0170f4ed /builtin/commit.c
parentb1e3333068247ddd44021a0b69457c249ddee7a1 (diff)
pack-revindex: factor out `midx_key_to_pack_pos()` helper
The `midx_to_pack_pos()` function implements a binary search over objects in the MIDX between lexical and pseudo-pack order. It does this by taking in an index into the lexical order (i.e. the same argument you'd use for `nth_midxed_object_id()` and similar) and spits out a position in the pseudo-pack order. This works for all callers, since they currently all are translating from lexical order to pseudo-pack order. But future callers may want to translate a known (offset, pack_id) tuple into an index into the psuedo-pack order, without knowing where that (offset, pack_id) tuple appears in lexical order. Prepare for implementing a function that translates between a (offset, pack_id) tuple into an index into the psuedo-pack order by extracting a helper function which does just that, and then reimplementing midx_to_pack_pos() in terms of it. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions