mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-39487: Merge duplicated _Py_IDENTIFIER identifiers in C code (GH-18254)
Moving repetitive `_Py_IDENTIFIER` instances to a global location helps identify them more easily in regards to sub-interpreter support.
This commit is contained in:
parent
c232c9110c
commit
46874c26ee
12 changed files with 24 additions and 34 deletions
|
|
@ -526,6 +526,8 @@ struct _odictnode {
|
|||
#define _odict_FOREACH(od, node) \
|
||||
for (node = _odict_FIRST(od); node != NULL; node = _odictnode_NEXT(node))
|
||||
|
||||
_Py_IDENTIFIER(items);
|
||||
|
||||
/* Return the index into the hash table, regardless of a valid node. */
|
||||
static Py_ssize_t
|
||||
_odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash)
|
||||
|
|
@ -896,7 +898,6 @@ static PyObject *
|
|||
odict_reduce(register PyODictObject *od, PyObject *Py_UNUSED(ignored))
|
||||
{
|
||||
_Py_IDENTIFIER(__dict__);
|
||||
_Py_IDENTIFIER(items);
|
||||
PyObject *dict = NULL, *result = NULL;
|
||||
PyObject *items_iter, *items, *args = NULL;
|
||||
|
||||
|
|
@ -1375,7 +1376,6 @@ static PyObject *
|
|||
odict_repr(PyODictObject *self)
|
||||
{
|
||||
int i;
|
||||
_Py_IDENTIFIER(items);
|
||||
PyObject *pieces = NULL, *result = NULL;
|
||||
|
||||
if (PyODict_SIZE(self) == 0)
|
||||
|
|
@ -2195,7 +2195,6 @@ mutablemapping_update(PyObject *self, PyObject *args, PyObject *kwargs)
|
|||
{
|
||||
int res = 0;
|
||||
Py_ssize_t len;
|
||||
_Py_IDENTIFIER(items);
|
||||
_Py_IDENTIFIER(keys);
|
||||
|
||||
/* first handle args, if any */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue