[Python-checkins] cpython: A hybrid of and-masking and a conditional-set-to-zero produce even faster
raymond.hettinger
python-checkins at python.org
Mon Jan 19 06:25:24 CET 2015
https://hg.python.org/cpython/rev/ac0d6c09457e
changeset: 94218:ac0d6c09457e
user: Raymond Hettinger <python at rcn.com>
date: Sun Jan 18 21:25:15 2015 -0800
summary:
A hybrid of and-masking and a conditional-set-to-zero produce even faster search loop.
files:
Objects/setobject.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Objects/setobject.c b/Objects/setobject.c
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -671,7 +671,8 @@
while ((entry = &so->table[i])->key == NULL || entry->key==dummy) {
i++;
- i &= so->mask;
+ if (i > so->mask)
+ i = 0;
}
key = entry->key;
entry->key = dummy;
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list