Re: [PATCH v2 01/10] reftable: stop using `strbuf_addbuf()`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 14, 2024 at 03:02:19PM +0200, Patrick Steinhardt wrote:
> 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@xxxxxx>
> ---
>  reftable/block.c  | 2 +-
>  reftable/record.c | 6 +++---
>  reftable/writer.c | 7 ++++---
>  3 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/reftable/block.c b/reftable/block.c
> index 8d41a2f99ed..cd4180eac7b 100644
> --- a/reftable/block.c
> +++ b/reftable/block.c
> @@ -60,7 +60,7 @@ static int block_writer_register_restart(struct block_writer *w, int n,
>  	w->next += n;
>
>  	strbuf_reset(&w->last_key);
> -	strbuf_addbuf(&w->last_key, key);
> +	strbuf_add(&w->last_key, key->buf, key->len);
>  	w->entries++;
>  	return 0;
>  }

OK, this makes sense. FWIW, it feels like this would have been an easy
function to port over to the new 'reftable_buf' type. But I understand
wanting to implement fewer functions if possible.

Thanks,
Taylor




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux