Hello Tim,

On 09/11/2021 12:09 AM, Tim Düsterhus wrote:
The programming style in OT is not what I'm used to, but if I understand
it correctly then maybe istmatchi() is what you are searching for (it
matches prefixes which should be what you are doing manually)?


yes, this function could be used instead of strncasecmp().  However, it
doesn't seem optimized to me and is certainly faster than strncasecmp()
for simple cases for strings where the difference is right at the
beginning.  Already after comparing strings longer than 4 characters
(and the first 4 are the same), the function is slower than
strncasecmp() and the duration of the function increases rapidly while
the processing time of the function strncasecmp() is quite stable).

I’m not writing this to start some deeper discussion, this is purely
informative.  :)

Best regards,

--
Miroslav Zagorac
Senior Developer

Reply via email to