reftable/writer: simplify writing index records
commitb66e006ff534c72c70132105fff06601aa60a625
authorPatrick Steinhardt <ps@pks.im>
Thu, 1 Feb 2024 07:52:04 +0000 (1 08:52 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 1 Feb 2024 19:11:32 +0000 (1 11:11 -0800)
tree96d07068448bd00d3743b03828e910831429a283
parent9ebb2d7b08c9f17a846b7c90082c9d15b9f6c9d2
reftable/writer: simplify writing index records

When finishing the current section some index records might be written
for the section to the table. The logic that adds these records to the
writer duplicates what we already have in `writer_add_record()`, making
this more complicated than it really has to be.

Simplify the code by using `writer_add_record()` instead. While at it,
drop the unneeded braces around a loop to make the code conform to our
code style better.

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