From: Antoine Pitrou Date: Thu, 13 Oct 2011 16:07:37 +0000 (+0200) Subject: Add a comment explaining this heuristic. X-Git-Tag: v3.3.0a1~1181 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c198d0599b7be72a1b88c7573897d7535cd89678;p=python Add a comment explaining this heuristic. --- diff --git a/Objects/stringlib/fastsearch.h b/Objects/stringlib/fastsearch.h index 0f7aea74a9..eb3d694cc6 100644 --- a/Objects/stringlib/fastsearch.h +++ b/Objects/stringlib/fastsearch.h @@ -115,6 +115,9 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n, unsigned char needle; needle = p[0] & 0xff; #if STRINGLIB_SIZEOF_CHAR > 1 + /* If looking for a multiple of 256, we'd have two + many false positives looking for the '\0' byte in UCS2 + and UCS4 representations. */ if (needle != 0) #endif return STRINGLIB(fastsearch_memchr_1char)