The only difference between `stack_compact_range_stats()` and `stack_compact_range()` is that the former updates stats on failure, whereas the latter doesn't. There are no callers anymore that do not want their stats updated though, making the indirection unnecessary. Inline the stat updates into `stack_compact_range()`. Signed-off-by: Patrick Steinhardt <ps@xxxxxx> --- reftable/stack.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/reftable/stack.c b/reftable/stack.c index d3a95d2f1d7..891ea971b72 100644 --- a/reftable/stack.c +++ b/reftable/stack.c @@ -1328,17 +1328,9 @@ static int stack_compact_range(struct reftable_stack *st, strbuf_release(&table_name); free_names(names); - return err; -} - -static int stack_compact_range_stats(struct reftable_stack *st, - size_t first, size_t last, - struct reftable_log_expiry_config *config, - unsigned int flags) -{ - int err = stack_compact_range(st, first, last, config, flags); if (err == REFTABLE_LOCK_ERROR) st->stats.failures++; + return err; } @@ -1346,7 +1338,7 @@ int reftable_stack_compact_all(struct reftable_stack *st, struct reftable_log_expiry_config *config) { size_t last = st->merged->readers_len ? st->merged->readers_len - 1 : 0; - return stack_compact_range_stats(st, 0, last, config, 0); + return stack_compact_range(st, 0, last, config, 0); } static int segment_size(struct segment *s) @@ -1452,8 +1444,8 @@ int reftable_stack_auto_compact(struct reftable_stack *st) st->opts.auto_compaction_factor); reftable_free(sizes); if (segment_size(&seg) > 0) - return stack_compact_range_stats(st, seg.start, seg.end - 1, - NULL, STACK_COMPACT_RANGE_BEST_EFFORT); + return stack_compact_range(st, seg.start, seg.end - 1, + NULL, STACK_COMPACT_RANGE_BEST_EFFORT); return 0; } -- 2.46.0.164.g477ce5ccd6.dirty