Re: [PATCH v10 3/9] strbuf: add a case insensitive starts_with()
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- Mar 9, 2018, 15:54 UTC
- Message-ID
- <7920610F-8B51-4E8F-83C6-7B29D0EBF852@gmail.com>
- In-Reply-To
- <xmqq4llq88ms.fsf@gitster-ct.c.googlers.com>
Show 16 quoted lines
> On 09 Mar 2018, at 00:12, Junio C Hamano <gitster@pobox.com> wrote: > > Duy Nguyen <pclouds@gmail.com> writes: > >>> extern int starts_with(const char *str, const char *prefix); >>> +extern int startscase_with(const char *str, const char *prefix); >> >> This name is a bit hard to read. Boost [1] goes with istarts_with. I >> wonder if it's better. If not I guess either starts_with_case or >> starts_case_with will improve readability. > > starts_with_case() sounds quite strange even though > starts_with_icase() may make it clear that it is "a variant of > starts_with() function that ignores case". I dunno. > dir.c::cmp_icase() takes the _icase suffix for not quite the way > that is consistent with that understanding, though.
I think following the boost lib makes most sense. Therefore, I would like to go with "istarts_with". OK with you?
- Lars