summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-06-21 17:47:20 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-06-21 17:47:20 (GMT)
commit7e3592dca6e9d1f991ef500e9c66c271474907b7 (patch)
treea319ff5358c76023728ef115fe36d36105f4e6cf /Objects
parent2e2f374098b42c15e6c084e21b76a4763022c7aa (diff)
downloadcpython-7e3592dca6e9d1f991ef500e9c66c271474907b7.zip
cpython-7e3592dca6e9d1f991ef500e9c66c271474907b7.tar.gz
cpython-7e3592dca6e9d1f991ef500e9c66c271474907b7.tar.bz2
Harmonize the bottom of the outer loop with its entry point
giving a small simplification. Timings show that hash pre-check seems only benefit the inner-loop (the linear probes).
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index d621647..70ec644 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -118,7 +118,7 @@ set_lookkey(PySetObject *so, PyObject *key, Py_hash_t hash)
i = (i * 5 + 1 + perturb) & mask;
entry = &table[i];
- if (entry->hash == 0 && entry->key == NULL)
+ if (entry->key == NULL)
return entry;
}
}
@@ -206,7 +206,7 @@ set_insert_key(PySetObject *so, PyObject *key, Py_hash_t hash)
i = (i * 5 + 1 + perturb) & mask;
entry = &table[i];
- if (entry->hash == 0 && entry->key == NULL)
+ if (entry->key == NULL)
goto found_null;
}