diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-12-11 10:07:50 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-12-11 07:23:16 -0800 |
commit | d779996a1087747886853f4e73cff920c09ab1a2 (patch) | |
tree | 90686911c1328cb140de679f27480e8bff5469c3 /builtin/commit.c | |
parent | 5c086453ff32a2ca07ac455594d59a9943b5d113 (diff) |
reftable/stack: reuse buffers when reloading stack
In `reftable_stack_reload_once()` we iterate over all the tables added
to the stack in order to figure out whether any of the tables needs to
be reloaded. We use a set of buffers in this context to compute the
paths of these tables, but discard those buffers on every iteration.
This is quite wasteful given that we do not need to transfer ownership
of the allocated buffer outside of the loop.
Refactor the code to instead reuse the buffers to reduce the number of
allocations we need to do. Note that we do not have to manually reset
the buffer because `stack_filename()` does this for us already.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions