]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/merged: simplify indices for subiterators
authorPatrick Steinhardt <ps@pks.im>
Mon, 13 May 2024 08:47:36 +0000 (10:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 May 2024 00:04:18 +0000 (17:04 -0700)
commit701713a254e7b8c955bc9a4a39a1eab17e1c457e
tree335dafd4be31c6bb46aad46c6fb847bf02a810bd
parente08f49a4f58e91cdcbc04190b501363fc568f0bf
reftable/merged: simplify indices for subiterators

When seeking on a merged table, we perform the seek for each of the
subiterators. If the subiterator has the desired record we add it to the
priority queue, otherwise we skip it and don't add it to the stack of
subiterators hosted by the merged table.

The consequence of this is that the index of the subiterator in the
merged table does not necessarily correspond to the index of it in the
merged iterator. Next to being potentially confusing, it also means that
we won't easily be able to re-seek the merged iterator because we have
no clear connection between both of the data structures.

Refactor the code so that the index stays the same in both structures.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/merged.c