aboutsummaryrefslogtreecommitdiff
path: root/reftable/block.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-02-26 18:10:24 -0800
committerJunio C Hamano <gitster@pobox.com>2024-02-26 18:10:24 -0800
commit9f67cbd0a7725857d219da6720fc9a5acfda2960 (patch)
treef7566b4db8e2f5d362d3464965e4a324d8d8516f /reftable/block.c
parent274400998b0a2da64d20e9fa95b288bf1403459c (diff)
parentc68ca7abd30b22404ce59d5133566729c07ffe8f (diff)
downloadgit-9f67cbd0a7725857d219da6720fc9a5acfda2960.tar.xz
Merge branch 'ps/reftable-iteration-perf'
The code to iterate over refs with the reftable backend has seen some optimization. * ps/reftable-iteration-perf: reftable/reader: add comments to `table_iter_next()` reftable/record: don't try to reallocate ref record name reftable/block: swap buffers instead of copying reftable/pq: allocation-less comparison of entry keys reftable/merged: skip comparison for records of the same subiter reftable/merged: allocation-less dropping of shadowed records reftable/record: introduce function to compare records by key
Diffstat (limited to 'reftable/block.c')
-rw-r--r--reftable/block.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/reftable/block.c b/reftable/block.c
index ce8a7d24f3..72eb73b380 100644
--- a/reftable/block.c
+++ b/reftable/block.c
@@ -339,8 +339,7 @@ int block_iter_next(struct block_iter *it, struct reftable_record *rec)
return -1;
string_view_consume(&in, n);
- strbuf_reset(&it->last_key);
- strbuf_addbuf(&it->last_key, &it->key);
+ strbuf_swap(&it->last_key, &it->key);
it->next_off += start.len - in.len;
return 0;
}