Message352046
More than -2, -1 -4 -8 -16 and -32 will cause many calls to __eq__.In `set_add_entry` use
```
perturb >>= PERTURB_SHIFT;
i = (i * 5 + 1 + perturb) & mask;
```
get the next index.In the example,mask is 7,perturb is -2. If i = 6, after execution, the value of i has not changed.We can do one more verification like:
```
do {
perturb >>= PERTURB_SHIFT;
} while (i == ((i * 5 + 1 + perturb) & mask));
i = (i * 5 + 1 + perturb) & mask;
```
Of course this requires tests. |
|
Date |
User |
Action |
Args |
2019-09-12 03:50:19 | hongweipeng | set | recipients:
+ hongweipeng, steven.daprano, serhiy.storchaka, crusaderky |
2019-09-12 03:50:19 | hongweipeng | set | messageid: <1568260219.76.0.652546275298.issue38105@roundup.psfhosted.org> |
2019-09-12 03:50:19 | hongweipeng | link | issue38105 messages |
2019-09-12 03:50:19 | hongweipeng | create | |
|