File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -245,15 +245,14 @@ STRINGLIB(_lex_search)(const STRINGLIB_CHAR *needle,
245245 */
246246 int dir = reversed ? -1 : 1 ;
247247 // starting position from chosen direction
248- Py_ssize_t stt = reversed ? m - 1 : 0 ;
249- Py_ssize_t m = needle_len ;
248+ Py_ssize_t stt = reversed ? needle_len - 1 : 0 ;
250249 Py_ssize_t max_suffix = 0 ;
251250 Py_ssize_t candidate = 1 ;
252251 Py_ssize_t k = 0 ;
253252 // The period of the right half.
254253 Py_ssize_t period = 1 ;
255254 STRINGLIB_CHAR a , b ;
256- while (candidate + k < m ) {
255+ while (candidate + k < needle_len ) {
257256 // each loop increases (in chosen direction) candidate + k + max_suffix
258257 a = needle [stt + dir * (candidate + k )];
259258 b = needle [stt + dir * (max_suffix + k )];
You can’t perform that action at this time.
0 commit comments