reftable/block: reuse buffer to compute record keys
commitc0cadb0576d4920915eb3bd38a7d1abfcbd25f98
authorPatrick Steinhardt <ps@pks.im>
Mon, 11 Dec 2023 09:08:12 +0000 (11 10:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 11 Dec 2023 15:23:17 +0000 (11 07:23 -0800)
tree6ab32c33c20cf845b16325bc36ee2bedaa8082b4
parenta8305bc6d8eb55cf52264964c8fc0289b72f2fd8
reftable/block: reuse buffer to compute record keys

When iterating over entries in the block iterator we compute the key of
each of the entries and write it into a buffer. We do not reuse the
buffer though and thus re-allocate it on every iteration, which is
wasteful.

Refactor the code to reuse the buffer.

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