Minor code cleanup.

This commit is contained in:
Raymond Hettinger 2015-06-24 01:22:19 -07:00
parent 049030b06a
commit 38bb95e49d
1 changed files with 5 additions and 3 deletions

View File

@ -53,7 +53,7 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
{
setentry *table = so->table;
setentry *entry;
size_t perturb = hash;
size_t perturb;
size_t mask = so->mask;
size_t i = (size_t)hash & mask; /* Unsigned for defined overflow behavior */
size_t j;
@ -63,6 +63,8 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
if (entry->key == NULL)
return entry;
perturb = hash;
while (1) {
if (entry->hash == hash) {
PyObject *startkey = entry->key;
@ -132,9 +134,9 @@ static int
set_insert_key(PySetObject *so, PyObject *key, Py_hash_t hash)
{
setentry *table = so->table;
setentry *freeslot = NULL;
setentry *freeslot;
setentry *entry;
size_t perturb = hash;
size_t perturb;
size_t mask = so->mask;
size_t i = (size_t)hash & mask; /* Unsigned for defined overflow behavior */
size_t j;