[Python-checkins] cpython (3.6): Issue #28040: Cleanup find_empty_slot()
victor.stinner
python-checkins at python.org
Tue Sep 13 10:00:14 EDT 2016
https://hg.python.org/cpython/rev/3c7456e28777
changeset: 103761:3c7456e28777
branch: 3.6
parent: 103759:a90daae58323
user: Victor Stinner <victor.stinner at gmail.com>
date: Tue Sep 13 09:38:29 2016 +0200
summary:
Issue #28040: Cleanup find_empty_slot()
find_empty_slot() only supports combined dict
files:
Objects/dictobject.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/Objects/dictobject.c b/Objects/dictobject.c
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -987,7 +987,7 @@
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 @@
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
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list