summaryrefslogtreecommitdiff
path: root/src/dict.c
diff options
context:
space:
mode:
authorPieter Noordhuis <pcnoordhuis@gmail.com>2013-04-23 10:02:36 -0700
committerantirez <antirez@gmail.com>2013-10-25 10:50:03 +0200
commitb63fbea5e4b86e21ce80f20d2649b407f5741495 (patch)
treec693be4f05c7619a418fe6ed664a6b7e2607fae6 /src/dict.c
parent7a6cfb18f31b18303e822ce3ad887fdf8c2138e9 (diff)
downloadredis-b63fbea5e4b86e21ce80f20d2649b407f5741495.tar.gz
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.
Diffstat (limited to 'src/dict.c')
-rw-r--r--src/dict.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/dict.c b/src/dict.c
index f4a44cf2e..946e23c4a 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -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;
}