On 07/07/10 17:07, Simon Josefsson wrote:
> Pádraig Brady <p...@draigbrady.com> writes:
> 
>> +    /* The following is equivalent to:
>> +         return memmem (s, strlen(s), c, csize);
>> +       but faster for long S with matching UC near the start,
>> +       and also memmem is sometimes buggy and inefficient.  */
>>      switch (u8_uctomb_aux (c, uc, 6))
> 
> Don't we have an efficient memmem in gnulib that this code could use?

Well the current replacement isn't great for small needles.
Also since we don't know the length of the string up front
we would also waste a bit of time on the strlen().

cheers,
Pádraig.

Reply via email to