diff options
author | Salvatore Sanfilippo <antirez@gmail.com> | 2018-07-17 10:38:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-17 10:38:55 +0200 |
commit | 4fc2099235a9214a953390340e94ec632cc16344 (patch) | |
tree | a704d5965fd7d223c4370b6d069e2fc1f9ec327b | |
parent | 9fbd49bbaf390c1713353fcb462ef436e2d52547 (diff) | |
parent | b6ce7d5ddce573f500b8770d9052e0c422c91500 (diff) | |
download | redis-4fc2099235a9214a953390340e94ec632cc16344.tar.gz |
Merge pull request #5128 from kingpeterpaule/remove-one-loop-in-freeMemoryIfNeeded
remove ineffective loop in dictGetSomeKeys.
-rw-r--r-- | src/dict.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dict.c b/src/dict.c index 738b38c46..95a141d0d 100644 --- a/src/dict.c +++ b/src/dict.c @@ -705,8 +705,10 @@ unsigned int dictGetSomeKeys(dict *d, dictEntry **des, unsigned int count) { * table, there will be no elements in both tables up to * the current rehashing index, so we jump if possible. * (this happens when going from big to small table). */ - if (i >= d->ht[1].size) i = d->rehashidx; - continue; + if (i >= d->ht[1].size) + i = d->rehashidx; + else + continue; } if (i >= d->ht[j].size) continue; /* Out of range for this table. */ dictEntry *he = d->ht[j].table[i]; |