Date: Fri, 22 Feb 2013 00:20:17 -0500 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: strcasestr.c On Wed, Feb 20, 2013 at 08:03:28PM -0500, Rich Felker wrote: > My leaning right now would be to write the naive strstr loop using > strcasecmp instead of strcmp (or an inline loop) for the inner loop. > This will cause strcasestr to have the exact same case-folding > semantics as strcasecmp, whatever those are in the future. This is > best for consistency. Unfortunately, it's very bad from a performance > standpoint, but I don't know of any code using this function for > high-performance use. I just committed an utterly trivial, working strcasestr based on this principle. At least it's better than what we had before. I hope nobody objects too much. It's 79 bytes of code (97 bytes for PIC) on x86 and that's with -O3. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.