reftable: rename scratch buffer

Both `struct block_writer` and `struct reftable_writer` have a `buf`
member that is being reused to optimize the number of allocations.
Rename the variable to `scratch` to clarify its intend and provide a
comment explaining why it exists.

Suggested-by: Christian Couder <christian.couder@gmail.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Patrick Steinhardt
2024-11-25 08:34:43 +01:00
committed by Junio C Hamano
parent 0f5762b043
commit ef46ad0815
4 changed files with 20 additions and 18 deletions

View File

@@ -39,7 +39,8 @@ struct block_writer {
uint32_t restart_cap;
struct reftable_buf last_key;
struct reftable_buf buf;
/* Scratch buffer used to avoid allocations. */
struct reftable_buf scratch;
int entries;
};