summaryrefslogtreecommitdiffstats
path: root/reftable/record.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-10-17 06:53:45 +0200
committerTaylor Blau <me@ttaylorr.com>2024-10-17 22:59:55 +0200
commit409f04995e6ede838576fb795cf45dc6f10ab508 (patch)
tree89a13d5b9d4bdc63b029b3047ccb124bb85de9fb /reftable/record.c
parentStart the 2.48 cycle (diff)
downloadgit-409f04995e6ede838576fb795cf45dc6f10ab508.tar.xz
git-409f04995e6ede838576fb795cf45dc6f10ab508.zip
reftable: stop using `strbuf_addbuf()`
We're about to introduce our own `reftable_buf` type to replace `strbuf`. Get rid of the seldomly-used `strbuf_addbuf()` function such that we have to reimplement one less function. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'reftable/record.c')
-rw-r--r--reftable/record.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/reftable/record.c b/reftable/record.c
index 30d563e16d..87157f2c38 100644
--- a/reftable/record.c
+++ b/reftable/record.c
@@ -1031,7 +1031,7 @@ static void reftable_index_record_key(const void *r, struct strbuf *dest)
{
const struct reftable_index_record *rec = r;
strbuf_reset(dest);
- strbuf_addbuf(dest, &rec->last_key);
+ strbuf_add(dest, rec->last_key.buf, rec->last_key.len);
}
static int reftable_index_record_copy_from(void *rec, const void *src_rec,
@@ -1041,7 +1041,7 @@ static int reftable_index_record_copy_from(void *rec, const void *src_rec,
const struct reftable_index_record *src = src_rec;
strbuf_reset(&dst->last_key);
- strbuf_addbuf(&dst->last_key, &src->last_key);
+ strbuf_add(&dst->last_key, src->last_key.buf, src->last_key.len);
dst->offset = src->offset;
return 0;
@@ -1085,7 +1085,7 @@ static int reftable_index_record_decode(void *rec, struct strbuf key,
int n = 0;
strbuf_reset(&r->last_key);
- strbuf_addbuf(&r->last_key, &key);
+ strbuf_add(&r->last_key, key.buf, key.len);
n = get_var_int(&r->offset, &in);
if (n < 0)