Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore comment and fix typo
  • Loading branch information
sweeneyde committed Oct 17, 2020
commit 9d7bbc38ddcdc640779e511f785a461d08cadf14
9 changes: 8 additions & 1 deletion Objects/stringlib/fastsearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
https://bugs.python.org/issue41972
*/

/* note: fastsearch may access s[n], which isn't a problem when using
Python's ordinary string types, but may cause problems if you're
using this code in other contexts. also, the count mode returns -1
if there cannot possible be a match in the target string, and 0 if
it has actually checked for matches, but didn't find any. callers
beware! */

#define FAST_COUNT 0
#define FAST_SEARCH 1
#define FAST_RSEARCH 2
Expand Down Expand Up @@ -581,7 +588,7 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
}

/* Short needles use Fredrik Lundh's Horspool/Sunday hybrid
aglorithm for less overhead. */
algorithm for less overhead. */
const STRINGLIB_CHAR *ss = s + m - 1;
const STRINGLIB_CHAR *pp = p + m - 1;

Expand Down