Don't call lookdict_index
in delitemif_lock_held
#117826
Labels
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
lookdict_index
in delitemif_lock_held
#117826
The
delitemif_lock_held
function callslookdict_index
and passes the returnedhashpos
todelitem_common
. We should just pass the actualhash
todelitem_common
.The existing code is confusing and unnecessary, but it's not exactly a bug. The behavior is fine because it's safe in this case to pretend the hashtable index (
hashpos
) is a hash value. The resultingsize_t i = (size_t)hash & mask
to compute the index from the hash is effectively a no-op.cpython/Objects/dictobject.c
Lines 2635 to 2645 in 069de14
cpython/Objects/dictobject.c
Lines 2502 to 2504 in 069de14
cpython/Objects/dictobject.c
Lines 995 to 1000 in 069de14
Linked PRs
The text was updated successfully, but these errors were encountered: