Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
86de089a
Unverified
Commit
86de089a
authored
Jun 01, 2018
by
Salvatore Sanfilippo
Committed by
GitHub
Jun 01, 2018
Browse files
Merge pull request #4907 from youjiali1995/fix-dictScan
Fix dictScan(): It can't scan all buckets when dict is shrinking.
parents
d168b245
8d93f924
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/dict.c
View file @
86de089a
...
...
@@ -858,6 +858,15 @@ unsigned long dictScan(dict *d,
de
=
next
;
}
/* Set unmasked bits so incrementing the reversed cursor
* operates on the masked bits */
v
|=
~
m0
;
/* Increment the reverse cursor */
v
=
rev
(
v
);
v
++
;
v
=
rev
(
v
);
}
else
{
t0
=
&
d
->
ht
[
0
];
t1
=
&
d
->
ht
[
1
];
...
...
@@ -892,22 +901,16 @@ unsigned long dictScan(dict *d,
de
=
next
;
}
/* Increment bits not covered by the smaller mask */
v
=
(((
v
|
m0
)
+
1
)
&
~
m0
)
|
(
v
&
m0
);
/* Increment the reverse cursor not covered by the smaller mask.*/
v
|=
~
m1
;
v
=
rev
(
v
);
v
++
;
v
=
rev
(
v
);
/* Continue while bits covered by mask difference is non-zero */
}
while
(
v
&
(
m0
^
m1
));
}
/* Set unmasked bits so incrementing the reversed cursor
* operates on the masked bits of the smaller table */
v
|=
~
m0
;
/* Increment the reverse cursor */
v
=
rev
(
v
);
v
++
;
v
=
rev
(
v
);
return
v
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment