mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Correctly compare the hint against the keys in _PyDict_GetItemHint (GH-22960)
This commit is contained in:
parent
4a9c637938
commit
492d513ccb
1 changed files with 1 additions and 1 deletions
|
@ -1448,7 +1448,7 @@ _PyDict_GetItemHint(PyDictObject *mp, PyObject *key,
|
|||
assert(PyDict_CheckExact((PyObject*)mp));
|
||||
assert(PyUnicode_CheckExact(key));
|
||||
|
||||
if (hint >= 0 && hint < _PyDict_KeysSize(mp->ma_keys)) {
|
||||
if (hint >= 0 && hint < mp->ma_keys->dk_nentries) {
|
||||
PyObject *res = NULL;
|
||||
|
||||
PyDictKeyEntry *ep = DK_ENTRIES(mp->ma_keys) + (size_t)hint;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue