Skip to content

Commit 7bcc257

Browse files
authored
gh-117826: Remove lookdict_index from delitemif_lock_held (gh-117869)
1 parent 74b0658 commit 7bcc257

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,7 +2603,7 @@ static int
26032603
delitemif_lock_held(PyObject *op, PyObject *key,
26042604
int (*predicate)(PyObject *value))
26052605
{
2606-
Py_ssize_t hashpos, ix;
2606+
Py_ssize_t ix;
26072607
PyDictObject *mp;
26082608
Py_hash_t hash;
26092609
PyObject *old_value;
@@ -2632,14 +2632,11 @@ delitemif_lock_held(PyObject *op, PyObject *key,
26322632
if (res == -1)
26332633
return -1;
26342634

2635-
hashpos = lookdict_index(mp->ma_keys, hash, ix);
2636-
assert(hashpos >= 0);
2637-
26382635
if (res > 0) {
26392636
PyInterpreterState *interp = _PyInterpreterState_GET();
26402637
uint64_t new_version = _PyDict_NotifyEvent(
26412638
interp, PyDict_EVENT_DELETED, mp, key, NULL);
2642-
return delitem_common(mp, hashpos, ix, old_value, new_version);
2639+
return delitem_common(mp, hash, ix, old_value, new_version);
26432640
} else {
26442641
return 0;
26452642
}

0 commit comments

Comments
 (0)