Neaten the code without any algorithmic change. (GH-10466)

Remove unneeded assertion (we already know so is a PySetObject *).
This commit is contained in:
Raymond Hettinger 2018-11-11 14:35:47 -08:00 committed by GitHub
parent b086c8afdb
commit f9ec1b9f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions

View File

@ -701,17 +701,14 @@ static PyObject *
set_pop(PySetObject *so, PyObject *Py_UNUSED(ignored))
{
/* Make sure the search finger is in bounds */
setentry *entry, *limit;
setentry *entry = so->table + (so->finger & so->mask);
setentry *limit = so->table + so->mask;
PyObject *key;
assert (PyAnySet_Check(so));
if (so->used == 0) {
PyErr_SetString(PyExc_KeyError, "pop from an empty set");
return NULL;
}
entry = so->table + (so->finger & so->mask);
limit = so->table + so->mask;
while (entry->key == NULL || entry->key==dummy) {
entry++;
if (entry > limit)