mirror of
https://github.com/python/cpython.git
synced 2025-10-15 19:29:46 +00:00
Issue #19512: add _PyUnicode_CompareWithId() function
_PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString() when both strings are equal and interned. Add also _PyId_builtins identifier for "builtins" common string.
This commit is contained in:
parent
937114f704
commit
ad14ccd047
6 changed files with 32 additions and 15 deletions
|
@ -1996,6 +1996,11 @@ PyAPI_FUNC(int) PyUnicode_Compare(
|
|||
PyObject *right /* Right string */
|
||||
);
|
||||
|
||||
PyAPI_FUNC(int) _PyUnicode_CompareWithId(
|
||||
PyObject *left, /* Left string */
|
||||
_Py_Identifier *right /* Right identifier */
|
||||
);
|
||||
|
||||
PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
|
||||
PyObject *left,
|
||||
const char *right /* ASCII-encoded string */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue