mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +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
|
@ -147,9 +147,10 @@ typedef struct _Py_Identifier {
|
|||
#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
|
||||
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
|
||||
|
||||
/* Common identifiers */
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_path;
|
||||
/* Common identifiers (ex: _PyId_path is the string "path") */
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_argv;
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_builtins;
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_path;
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_stdin;
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_stdout;
|
||||
PyAPI_DATA(_Py_Identifier) _PyId_stderr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue