mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
A hybrid of and-masking and a conditional-set-to-zero produce even faster search loop.
This commit is contained in:
parent
bd9b200b87
commit
ed741d4ff0
1 changed files with 2 additions and 1 deletions
|
@ -671,7 +671,8 @@ set_pop(PySetObject *so)
|
||||||
|
|
||||||
while ((entry = &so->table[i])->key == NULL || entry->key==dummy) {
|
while ((entry = &so->table[i])->key == NULL || entry->key==dummy) {
|
||||||
i++;
|
i++;
|
||||||
i &= so->mask;
|
if (i > so->mask)
|
||||||
|
i = 0;
|
||||||
}
|
}
|
||||||
key = entry->key;
|
key = entry->key;
|
||||||
entry->key = dummy;
|
entry->key = dummy;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue