]> Kevux Git Server - rit/commit
reftable/block: make block iterators reseekable
authorPatrick Steinhardt <ps@pks.im>
Mon, 7 Apr 2025 13:16:23 +0000 (15:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Apr 2025 21:53:11 +0000 (14:53 -0700)
commit6da48a5e00ae77c4092e78ac8ac8641a90660343
tree5e0241841f4538cafe58f86d1994d2c1ba7ec62d
parent156d79cef0de565408e41f840bbda87114367977
reftable/block: make block iterators reseekable

Refactor the block iterators so that initialization and seeking are
different from one another. This makes the iterator trivially reseekable
by storing the pointer to the block at initialization time, which we can
then reuse on every seek.

This refactoring prepares the code for exposing a `reftable_iterator`
interface for blocks in a subsequent commit. Callsites are adjusted
accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/block.c
reftable/block.h
reftable/iter.c
reftable/table.c
t/unit-tests/t-reftable-block.c