[PATCH 0/7] reftable: improvements for the `binsearch()` mechanism
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Mar 22, 2024, 12:22 UTC
- Message-ID
- <cover.1711109214.git.ps@pks.im>
Hi,
this patch series contains various improvements for the `binsearch()` mechanism used by the reftable library:
- Callsites are refactored to make it more obvious what exactly they
are doing. This mostly involves improved names for callback
functions. - Error handling is improved such that binsearch() knows to abort when
the callback returns a negative value. - Error handling for binary searching over restart counters is fixed
so that we check for errors at the correct point in time. - Decoding of record keys is refactored when searching over restart
counters to not require allocations anymore.Thanks!
Patrick
Patrick Steinhardt (7): reftable/basics: fix return type of `binsearch()` to be `size_t` reftable/basics: improve `binsearch()` test reftable/refname: refactor binary search over refnames reftable/block: refactor binary search over restart points reftable/block: fix error handling when searching restart points reftable/record: extract function to decode key lengths reftable/block: avoid decoding keys when searching restart points
reftable/basics.c | 7 ++- reftable/basics.h | 7 +-- reftable/basics_test.c | 55 +++++++++++--------- reftable/block.c | 114 ++++++++++++++++++++++++++++++----------- reftable/record.c | 34 ++++++++---- reftable/record.h | 6 +++ reftable/refname.c | 53 +++++++++---------- 7 files changed, 179 insertions(+), 97 deletions(-)
-- 2.44.0