summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2015-12-15 08:42:30 (GMT)
committerRaymond Hettinger <python@rcn.com>2015-12-15 08:42:30 (GMT)
commite4495877dd08b4d0568bb8a75ae5c69b3d91ff60 (patch)
tree92647049484165899a897f5ee561dbdd6e5991f2
parentf4f67e52b4bdab792e111ba024ddd223f24909df (diff)
downloadcpython-e4495877dd08b4d0568bb8a75ae5c69b3d91ff60.zip
cpython-e4495877dd08b4d0568bb8a75ae5c69b3d91ff60.tar.gz
cpython-e4495877dd08b4d0568bb8a75ae5c69b3d91ff60.tar.bz2
Minor tweek. Counting down rather than up reduces register pressure.
-rw-r--r--Objects/setobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 4723b58..45aa200 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -678,7 +678,7 @@ set_merge(PySetObject *so, PyObject *otherset)
size_t newmask = (size_t)so->mask;
so->fill = other->used;
so->used = other->used;
- for (i = 0; i <= other->mask; i++, other_entry++) {
+ for (i = other->mask + 1; i > 0 ; i--, other_entry++) {
key = other_entry->key;
if (key != NULL && key != dummy) {
Py_INCREF(key);