mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Slight rearrangement of code in lookdict() by Vladimir Marangozov, to
make a common case slightly faster.
This commit is contained in:
parent
73290dff30
commit
c1c7b1a699
1 changed files with 3 additions and 4 deletions
|
@ -173,14 +173,13 @@ lookdict(mp, key, hash)
|
|||
as for ints <sigh>, can have lots of leading zeros. It's not
|
||||
really a performance risk, but better safe than sorry. */
|
||||
ep = &ep0[i];
|
||||
if (ep->me_key == NULL)
|
||||
if (ep->me_key == NULL || ep->me_key == key)
|
||||
return ep;
|
||||
if (ep->me_key == dummy)
|
||||
freeslot = ep;
|
||||
else {
|
||||
if (ep->me_key == key ||
|
||||
(ep->me_hash == hash &&
|
||||
PyObject_Compare(ep->me_key, key) == 0))
|
||||
if (ep->me_hash == hash &&
|
||||
PyObject_Compare(ep->me_key, key) == 0)
|
||||
{
|
||||
return ep;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue