mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Optimize _PyUnicode_FindMaxChar() find pure ASCII strings
This commit is contained in:
parent
fea73efc9e
commit
94d558b063
1 changed files with 3 additions and 0 deletions
|
@ -1985,6 +1985,9 @@ _PyUnicode_FindMaxChar(PyObject *unicode, Py_ssize_t start, Py_ssize_t end)
|
|||
if (start == end)
|
||||
return 127;
|
||||
|
||||
if (PyUnicode_IS_ASCII(unicode))
|
||||
return 127;
|
||||
|
||||
kind = PyUnicode_KIND(unicode);
|
||||
startptr = PyUnicode_DATA(unicode);
|
||||
endptr = (char *)startptr + end * kind;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue