]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/merged: split up initialization and seeking of records
authorPatrick Steinhardt <ps@pks.im>
Mon, 13 May 2024 08:47:31 +0000 (10:47 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 May 2024 00:04:17 +0000 (17:04 -0700)
commite08f49a4f58e91cdcbc04190b501363fc568f0bf
tree99e179af01f09f562e30e126b43108cdae1d58f3
parentc82692f75591b320fbe5f4d2018505bd902f95e6
reftable/merged: split up initialization and seeking of records

To initialize a `struct merged_iter`, we need to seek all subiterators
to the wanted record and then add their results to the priority queue
used to sort the records. This logic is split up across two functions,
`merged_table_seek_record()` and `merged_iter_init()`. The scope of
these functions is somewhat weird though, where `merged_iter_init()` is
only responsible for adding the records of the subiterators to the
priority queue.

Clarify the scope of those functions such that `merged_iter_init()` is
only responsible for initializing the iterator's structure. Performing
the subiterator seeks are now part of `merged_table_seek_record()`.

This step is required to move seeking of records into the generic
`struct reftable_iterator` infrastructure.

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