]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/block: refactor binary search over restart points
authorPatrick Steinhardt <ps@pks.im>
Wed, 3 Apr 2024 06:04:09 +0000 (08:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2024 16:16:50 +0000 (09:16 -0700)
commit77307a61d6d6f17dcbf7534c512af370185a4391
treeb074571ed8f03875cfdf02b90a9cfdf37e90618f
parent21767925b034f9ce7b4623433954b9bd0af81248
reftable/block: refactor binary search over restart points

When seeking a record in our block reader we perform a binary search
over the block's restart points so that we don't have to do a linear
scan over the whole block. The logic to do so is quite intricate though,
which makes it hard to understand.

Improve documentation and rename some of the functions and variables so
that the code becomes easier to understand overall. This refactoring
should not result in any change in behaviour.

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