summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2018-11-11 22:35:47 (GMT)
committerGitHub <noreply@github.com>2018-11-11 22:35:47 (GMT)
commitf9ec1b9f5257b7a1cb6770e8398da626c86a5b7b (patch)
tree632de7dab62c1c00fddafcfecb2d6829d440fad2 /Objects
parentb086c8afdb8c862011e3e27d4c8f6833749f2c56 (diff)
downloadcpython-f9ec1b9f5257b7a1cb6770e8398da626c86a5b7b.zip
cpython-f9ec1b9f5257b7a1cb6770e8398da626c86a5b7b.tar.gz
cpython-f9ec1b9f5257b7a1cb6770e8398da626c86a5b7b.tar.bz2
Neaten the code without any algorithmic change. (GH-10466)
Remove unneeded assertion (we already know so is a PySetObject *).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index ce50921..035b1db 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -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)