diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-09-13 07:38:29 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-09-13 07:38:29 (GMT) |
commit | 9926480b6aaab60d2c5f710e7fc60061c52f6f08 (patch) | |
tree | f0653ef87e0e7561e7e75563e6f33048b9f238a7 /Objects | |
parent | b2317a4d9d7c94f5026a07c48118b58500ac1e79 (diff) | |
download | cpython-9926480b6aaab60d2c5f710e7fc60061c52f6f08.zip cpython-9926480b6aaab60d2c5f710e7fc60061c52f6f08.tar.gz cpython-9926480b6aaab60d2c5f710e7fc60061c52f6f08.tar.bz2 |
Issue #28040: Cleanup find_empty_slot()
find_empty_slot() only supports combined dict
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/dictobject.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 8b88ec6..bb5962a 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -987,7 +987,7 @@ _PyDict_MaybeUntrack(PyObject *op) when it is known that the key is not present in the dict. The dict must be combined. */ -static Py_ssize_t +static void find_empty_slot(PyDictObject *mp, PyObject *key, Py_hash_t hash, 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]; *hashpos = i & mask; assert(ep->me_value == NULL); - if (mp->ma_values) - *value_addr = &mp->ma_values[ix]; - else - *value_addr = &ep->me_value; - return ix; + *value_addr = &ep->me_value; } static int |