mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
(cherry picked from commit 85ec3b3b50
)
This commit is contained in:
parent
823bf76d37
commit
2383c6015c
3 changed files with 14 additions and 4 deletions
|
@ -588,7 +588,7 @@ STRINGLIB(default_find)(const STRINGLIB_CHAR* s, Py_ssize_t n,
|
|||
continue;
|
||||
}
|
||||
/* miss: check if next character is part of pattern */
|
||||
if (!STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
if (i + 1 <= w && !STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
i = i + m;
|
||||
}
|
||||
else {
|
||||
|
@ -597,7 +597,7 @@ STRINGLIB(default_find)(const STRINGLIB_CHAR* s, Py_ssize_t n,
|
|||
}
|
||||
else {
|
||||
/* skip: check if next character is part of pattern */
|
||||
if (!STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
if (i + 1 <= w && !STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
i = i + m;
|
||||
}
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ STRINGLIB(adaptive_find)(const STRINGLIB_CHAR* s, Py_ssize_t n,
|
|||
}
|
||||
}
|
||||
/* miss: check if next character is part of pattern */
|
||||
if (!STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
if (i + 1 <= w && !STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
i = i + m;
|
||||
}
|
||||
else {
|
||||
|
@ -670,7 +670,7 @@ STRINGLIB(adaptive_find)(const STRINGLIB_CHAR* s, Py_ssize_t n,
|
|||
}
|
||||
else {
|
||||
/* skip: check if next character is part of pattern */
|
||||
if (!STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
if (i + 1 <= w && !STRINGLIB_BLOOM(mask, ss[i+1])) {
|
||||
i = i + m;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue