Mercurial > cpython-lru_cache-weakref
diff Python/errors.c @ 86980:77bebcf5c4cf
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.
| author | Victor Stinner <victor.stinner@gmail.com> |
|---|---|
| date | Thu, 07 Nov 2013 00:46:04 +0100 |
| parents | 954167ce92a3 |
| children | 01c4a0af73cf |
line wrap: on
line diff
--- a/Python/errors.c Thu Nov 07 00:12:30 2013 +0100 +++ b/Python/errors.c Thu Nov 07 00:46:04 2013 +0100 @@ -878,7 +878,7 @@ 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)
