0
0
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:
Guido van Rossum 1995-01-02 19:42:39 +00:00
parent 3bbc62e9c2
commit efc8713428
2 changed files with 6 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}