From c198d0599b7be72a1b88c7573897d7535cd89678 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 13 Oct 2011 18:07:37 +0200 Subject: Add a comment explaining this heuristic. --- Objects/stringlib/fastsearch.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Objects/stringlib/fastsearch.h b/Objects/stringlib/fastsearch.h index 0f7aea7..eb3d694 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) -- cgit v0.12