lkml.org 
[lkml]   [2022]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH linux-phy v2 1/4] string.h: Add str_has_proper_prefix()
On Thu, Aug 18, 2022 at 10:48 PM Marek Behún <kabel@kernel.org> wrote:
> On Thu, 18 Aug 2022 22:10:58 +0300
> Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > On Wed, Aug 17, 2022 at 11:06 PM Marek Behún <kabel@kernel.org> wrote:

...

> > Besides not the good naming (what 'proper' means),
>
> The naming comes from similar naming in math: proper subset is as
> subset that is not equal to the superset. See
> https://en.wikipedia.org/wiki/Substring :
> "A proper prefix of a string is not equal to the string itself"

It's nice to learn something, but I still think that name has too
broad meaning(s) that may easily confuse the developers.

>
> > the entire function is not needed. You may simply call
> >
> > str_has_prefix() && p[len] != '\0';
> >
> > Correct?
>
> Do you mean that I should implement this function to simply return
> str_has_prefix() && p[len] != '\0'
> or that this function should not exist at all and I should do that in
> the code where I would have used the function?

The latter since this seems do not have users, except a single newcomer,

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-08-18 21:58    [W:0.461 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site