mirror of
https://github.com/python/cpython.git
synced 2024-11-28 08:20:55 +01:00
* Objects/mappingobject.c (mappingremove): don't call
lookmapping() for empty dictionary
This commit is contained in:
parent
3bbc62e9c2
commit
efc8713428
@ -322,8 +322,11 @@ mappingremove(op, key)
|
||||
if (hash == -1)
|
||||
return -1;
|
||||
mp = (mappingobject *)op;
|
||||
if (((mappingobject *)op)->ma_table == NULL)
|
||||
goto empty;
|
||||
ep = lookmapping(mp, key, hash);
|
||||
if (ep->me_value == NULL) {
|
||||
empty:
|
||||
err_setval(KeyError, key);
|
||||
return -1;
|
||||
}
|
||||
|
@ -322,8 +322,11 @@ mappingremove(op, key)
|
||||
if (hash == -1)
|
||||
return -1;
|
||||
mp = (mappingobject *)op;
|
||||
if (((mappingobject *)op)->ma_table == NULL)
|
||||
goto empty;
|
||||
ep = lookmapping(mp, key, hash);
|
||||
if (ep->me_value == NULL) {
|
||||
empty:
|
||||
err_setval(KeyError, key);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user