From b63fbea5e4b86e21ce80f20d2649b407f5741495 Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Tue, 23 Apr 2013 10:02:36 -0700 Subject: [PATCH] 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. --- src/dict.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/dict.c b/src/dict.c index f4a44cf2..946e23c4 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; }