summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2023-12-11 10:08:03 +0100
committerJunio C Hamano <gitster@pobox.com>2023-12-11 07:23:16 -0800
commit829231dc203f777a32ebdbbaf66e7661a21ac74a (patch)
tree2a87e741cd205217d022aaa39ee6dd38cfacd5f1 /builtin/commit.c
parent9abda98149e0f164ac0532fc6ca89b337049b9c3 (diff)
reftable/merged: reuse buffer to compute record keys
When iterating over entries in the merged iterator's queue, we compute the key of each of the entries and write it into a buffer. We do not reuse the buffer though and thus re-allocate it on every iteration, which is wasteful given that we never transfer ownership of the allocated bytes outside of the loop. Refactor the code to reuse the buffer. This also fixes a potential memory leak when `merged_iter_advance_subiter()` returns an error. 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