Re: [PATCH 09/26] strvec: introduce new `strvec_splice()` function

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

 



On Sun, Nov 10, 2024 at 10:39:08PM +0100, Rubén Justo wrote:
> On Wed, Nov 06, 2024 at 04:10:44PM +0100, Patrick Steinhardt wrote:
> > Introduce a new `strvec_splice()` function that can replace a range of
> > strings in the vector with another array of strings. This function will
> > be used in subsequent commits.
> > 
> > Signed-off-by: Patrick Steinhardt <ps@xxxxxx>
> > ---
> >  strvec.c              | 19 +++++++++++++
> >  strvec.h              |  9 ++++++
> >  t/unit-tests/strvec.c | 65 +++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 93 insertions(+)
> > 
> > diff --git a/strvec.c b/strvec.c
> > index f712070f574..81075c50cca 100644
> > --- a/strvec.c
> > +++ b/strvec.c
> > @@ -56,6 +56,25 @@ void strvec_pushv(struct strvec *array, const char **items)
> >  		strvec_push(array, *items);
> >  }
> >  
> > +void strvec_splice(struct strvec *array, size_t pos, size_t len,
> > +		   const char **replacement, size_t replacement_len)
> 
> There's nothing wrong with `replacement_len`, but it has caught my
> attention because in other strvec APIs we use null-terminated arrays.

Fair enough, but we do end up using this in a subsequent patch, as you
discovered in the next patch. So I'll leave this as-is.

Patrick




[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