mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Issue #28818: Simplify lookdict functions
This commit is contained in:
@@ -12,7 +12,7 @@ typedef struct {
|
||||
* -1 when no entry found, -3 when compare raises error.
|
||||
*/
|
||||
typedef Py_ssize_t (*dict_lookup_func)
|
||||
(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject ***value_addr,
|
||||
(PyDictObject *mp, PyObject *key, Py_hash_t hash, PyObject **value_addr,
|
||||
Py_ssize_t *hashpos);
|
||||
|
||||
#define DKIX_EMPTY (-1)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -535,11 +535,11 @@ _odict_free_fast_nodes(PyODictObject *od) {
|
||||
static Py_ssize_t
|
||||
_odict_get_index_raw(PyODictObject *od, PyObject *key, Py_hash_t hash)
|
||||
{
|
||||
PyObject **value_addr = NULL;
|
||||
PyObject *value = NULL;
|
||||
PyDictKeysObject *keys = ((PyDictObject *)od)->ma_keys;
|
||||
Py_ssize_t ix;
|
||||
|
||||
ix = (keys->dk_lookup)((PyDictObject *)od, key, hash, &value_addr, NULL);
|
||||
ix = (keys->dk_lookup)((PyDictObject *)od, key, hash, &value, NULL);
|
||||
if (ix == DKIX_EMPTY) {
|
||||
return keys->dk_nentries; /* index of new entry */
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user