mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
dict: Remove redundant incref of immortal object Py_EMPTY_KEYS (GH-133200)
This commit is contained in:
parent
cb35c11d82
commit
0119791326
1 changed files with 2 additions and 1 deletions
|
@ -4851,7 +4851,8 @@ dict_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
|
||||
d->ma_used = 0;
|
||||
d->_ma_watcher_tag = 0;
|
||||
dictkeys_incref(Py_EMPTY_KEYS);
|
||||
// We don't inc ref empty keys because they're immortal
|
||||
assert((Py_EMPTY_KEYS)->dk_refcnt == _Py_DICT_IMMORTAL_INITIAL_REFCNT);
|
||||
d->ma_keys = Py_EMPTY_KEYS;
|
||||
d->ma_values = NULL;
|
||||
ASSERT_CONSISTENT(d);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue