Skip to content

Commit 74822c1

Browse files
committed
Issue #28040: Cleanup find_empty_slot()
find_empty_slot() only supports combined dict
1 parent dcbed36 commit 74822c1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ _PyDict_MaybeUntrack(PyObject *op)
987987
when it is known that the key is not present in the dict.
988988
989989
The dict must be combined. */
990-
static Py_ssize_t
990+
static void
991991
find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash,
992992
PyObject ***value_addr, Py_ssize_t *hashpos)
993993
{
@@ -1011,11 +1011,7 @@ find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash,
10111011
ep = &ep0[mp->ma_keys->dk_nentries];
10121012
*hashpos = i & mask;
10131013
assert(ep->me_value == NULL);
1014-
if (mp->ma_values)
1015-
*value_addr = &mp->ma_values[ix];
1016-
else
1017-
*value_addr = &ep->me_value;
1018-
return ix;
1014+
*value_addr = &ep->me_value;
10191015
}
10201016

10211017
static int

0 commit comments

Comments
 (0)