[Python-checkins] cpython: Minor code cleanup.
raymond.hettinger
python-checkins at python.org
Wed Jun 24 10:22:23 CEST 2015
https://hg.python.org/cpython/rev/329247ce324a
changeset: 96651:329247ce324a
user: Raymond Hettinger <python at rcn.com>
date: Wed Jun 24 01:22:19 2015 -0700
summary:
Minor code cleanup.
files:
Objects/setobject.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -53,7 +53,7 @@
{
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 @@
if (entry->key == NULL)
return entry;
+ perturb = hash;
+
while (1) {
if (entry->hash == hash) {
PyObject *startkey = entry->key;
@@ -132,9 +134,9 @@
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;
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list