mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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:
parent
87c3c5de73
commit
778928b0c7
3 changed files with 132 additions and 270 deletions
|
|
@ -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 */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue