[PATCH] Improve generic strstr performance.

Roland McGrath roland@hack.frob.com
Tue May 12 21:07:00 GMT 2015


> +  if (!needle[1])

No implicit Boolean coercion:
	if (needle[1] == '\0')

> +          if (needle[2] == '\000')

Just write '\0' when you are talking about the terminator.  Use '\000' only
when it's in a context where literal octal values make real sense.

(I'm not reviewing the substance of your change.)



More information about the Libc-alpha mailing list