Kaydet (Commit) c198d059 authored tarafından Antoine Pitrou's avatar Antoine Pitrou

Add a comment explaining this heuristic.

üst dda339e6
...@@ -115,6 +115,9 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n, ...@@ -115,6 +115,9 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
unsigned char needle; unsigned char needle;
needle = p[0] & 0xff; needle = p[0] & 0xff;
#if STRINGLIB_SIZEOF_CHAR > 1 #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) if (needle != 0)
#endif #endif
return STRINGLIB(fastsearch_memchr_1char) return STRINGLIB(fastsearch_memchr_1char)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment