]> granicus.if.org Git - python/commitdiff
Add a comment explaining this heuristic.
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 13 Oct 2011 16:07:37 +0000 (18:07 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 13 Oct 2011 16:07:37 +0000 (18:07 +0200)
Objects/stringlib/fastsearch.h

index 0f7aea74a985495d147ffd80f5b7d29ecd5b4257..eb3d694cc6af2ff7a7a378ea346db9a60ea1786a 100644 (file)
@@ -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)