]> git.ipfire.org Git - thirdparty/git.git/commit - reftable/block.c
reftable/block: avoid decoding keys when searching restart points
authorPatrick Steinhardt <ps@pks.im>
Wed, 3 Apr 2024 06:04:29 +0000 (08:04 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Apr 2024 16:16:50 +0000 (09:16 -0700)
commitd51d8cc36831bdabbbcec8553a7e83d9f5a3be4d
treeca1c89a344a413031c106ee626af0652992d911c
parentcd75790707fe0068abff6729f0697e26c3630702
reftable/block: avoid decoding keys when searching restart points

When searching over restart points in a block we decode the key of each
of the records, which results in a memory allocation. This is quite
pointless though given that records it restart points will never use
prefix compression and thus store their keys verbatim in the block.

Refactor the code so that we can avoid decoding the keys, which saves us
some allocations.

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