Skip to content

Commit 9d7bbc3

Browse files
committed
Restore comment and fix typo
1 parent 89bdc34 commit 9d7bbc3

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Objects/stringlib/fastsearch.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
https://bugs.python.org/issue41972
2222
*/
2323

24+
/* note: fastsearch may access s[n], which isn't a problem when using
25+
Python's ordinary string types, but may cause problems if you're
26+
using this code in other contexts. also, the count mode returns -1
27+
if there cannot possible be a match in the target string, and 0 if
28+
it has actually checked for matches, but didn't find any. callers
29+
beware! */
30+
2431
#define FAST_COUNT 0
2532
#define FAST_SEARCH 1
2633
#define FAST_RSEARCH 2
@@ -581,7 +588,7 @@ FASTSEARCH(const STRINGLIB_CHAR* s, Py_ssize_t n,
581588
}
582589

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

0 commit comments

Comments
 (0)