This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improve generic strstr performance.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 12 May 2015 23:30:12 +0200
- Subject: Re: [PATCH] Improve generic strstr performance.
- Authentication-results: sourceware.org; auth=none
- References: <20150512205311 dot GA24057 at domone> <20150512210710 dot 5EEAD2C3AB9 at topped-with-meat dot com>
On Tue, May 12, 2015 at 02:07:10PM -0700, Roland McGrath wrote:
> > + 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.)
Ok, will change that before I would commit it.