mirror of
https://github.com/fluencelabs/redis
synced 2025-03-17 16:10:50 +00:00
Fix error in scan algorithm
The irrelevant bits shouldn't be masked to 1. This can result in slots being skipped when the hash table is resized between calls to the iterator.
This commit is contained in:
parent
7a6cfb18f3
commit
b63fbea5e4
@ -729,14 +729,6 @@ unsigned long dictScan(dict *d,
|
||||
v++;
|
||||
v = rev(v);
|
||||
|
||||
/* Only preprare cursor for the next iteration when it is non-zero,
|
||||
* so that 0 can be used as end-of-scan sentinel. */
|
||||
if (v) {
|
||||
/* Set unmasked bits so the cursor will keep its position
|
||||
* regardless of the mask in the next iterations */
|
||||
v |= ~m0;
|
||||
}
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user