mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +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
|
@ -878,7 +878,7 @@ PyErr_WriteUnraisable(PyObject *obj)
|
|||
goto done;
|
||||
}
|
||||
else {
|
||||
if (PyUnicode_CompareWithASCIIString(moduleName, "builtins") != 0) {
|
||||
if (_PyUnicode_CompareWithId(moduleName, &_PyId_builtins) != 0) {
|
||||
if (PyFile_WriteObject(moduleName, f, Py_PRINT_RAW) < 0)
|
||||
goto done;
|
||||
if (PyFile_WriteString(".", f) < 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue