bpo-29304: Simplify dict lookup functions (GH-2407)

* remove hashpos parameter from lookdict functions.
* remove many duplicated code from lookdict functions.
This commit is contained in:
INADA Naoki 2017-08-03 23:45:15 +09:00 committed by GitHub
parent 87c3c5de73
commit 778928b0c7
3 changed files with 132 additions and 270 deletions

View file

@ -546,7 +546,7 @@ _odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash)
PyDictKeysObject *keys = ((PyDictObject *)od)->ma_keys;
Py_ssize_t ix;
ix = (keys->dk_lookup)((PyDictObject *)od, key, hash, &value, NULL);
ix = (keys->dk_lookup)((PyDictObject *)od, key, hash, &value);
if (ix == DKIX_EMPTY) {
return keys->dk_nentries; /* index of new entry */
}