summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-03-27 10:10:22 +0100
committerantirez <antirez@gmail.com>2015-03-27 10:12:25 +0100
commit9cd8333ed283689b028a062fc43820fcf15fa81c (patch)
tree74e476af89bd3e5a485e827b1f4ed0cb1f3ea760
parentc3ad70901f962808a1c0c474951406af81d26a3f (diff)
downloadredis-9cd8333ed283689b028a062fc43820fcf15fa81c.tar.gz
dict.c: add casting to avoid compilation warning.
rehashidx is always positive in the two code paths, since the only negative value it could have is -1 when there is no rehashing in progress, and the condition is explicitly checked.
-rw-r--r--src/dict.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dict.c b/src/dict.c
index dbcfeb492..c6dbceaf2 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -716,7 +716,7 @@ unsigned int dictGetSomeKeys(dict *d, dictEntry **des, unsigned int count) {
/* Invariant of the dict.c rehashing: up to the indexes already
* visited in ht[0] during the rehashing, there are no populated
* buckets, so we can skip ht[0] for indexes between 0 and idx-1. */
- if (tables == 2 && j == 0 && i < d->rehashidx) {
+ if (tables == 2 && j == 0 && i < (unsigned int) d->rehashidx) {
/* Moreover, if we are currently out of range in the second
* table, there will be no elements in both tables up to
* the current rehashing index, so we jump if possible.