mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Issue #28040: Cleanup find_empty_slot()
find_empty_slot() only supports combined dict
This commit is contained in:
parent
b2317a4d9d
commit
9926480b6a
1 changed files with 2 additions and 6 deletions
|
@ -987,7 +987,7 @@ _PyDict_MaybeUntrack(PyObject *op)
|
||||||
when it is known that the key is not present in the dict.
|
when it is known that the key is not present in the dict.
|
||||||
|
|
||||||
The dict must be combined. */
|
The dict must be combined. */
|
||||||
static Py_ssize_t
|
static void
|
||||||
find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash,
|
find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash,
|
||||||
PyObject ***value_addr, Py_ssize_t *hashpos)
|
PyObject ***value_addr, Py_ssize_t *hashpos)
|
||||||
{
|
{
|
||||||
|
@ -1011,11 +1011,7 @@ find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash,
|
||||||
ep = &ep0[mp->ma_keys->dk_nentries];
|
ep = &ep0[mp->ma_keys->dk_nentries];
|
||||||
*hashpos = i & mask;
|
*hashpos = i & mask;
|
||||||
assert(ep->me_value == NULL);
|
assert(ep->me_value == NULL);
|
||||||
if (mp->ma_values)
|
*value_addr = &ep->me_value;
|
||||||
*value_addr = &mp->ma_values[ix];
|
|
||||||
else
|
|
||||||
*value_addr = &ep->me_value;
|
|
||||||
return ix;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue