]> git.ipfire.org Git - thirdparty/git.git/commit
reftable/stack: return stack segments directly
authorKarthik Nayak <karthik.188@gmail.com>
Sat, 8 Nov 2025 21:51:53 +0000 (22:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Nov 2025 17:28:47 +0000 (09:28 -0800)
commit135f491f83d4763bdc61642eb0126ce2e6ada286
tree97258afea604fa28bcd93fb3a11bd40b2155dd8b
parent31177a8bb6ee0a733342e0d67ee2b0f4b29263a2
reftable/stack: return stack segments directly

The `stack_table_sizes_for_compaction()` function returns individual
sizes of each reftable table. This function is only called by
`reftable_stack_auto_compact()` to decide which tables need to be
compacted, if any.

Modify the function to directly return the segments, which avoids the
extra step of receiving the sizes only to pass it to
`suggest_compaction_segment()`.

A future commit will also add functionality for checking whether
auto-compaction is necessary without performing it. This change allows
code re-usability in that context.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Acked-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
reftable/stack.c