summaryrefslogtreecommitdiff
path: root/src/evict.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2021-06-13 14:31:19 +0800
committerGitHub <noreply@github.com>2021-06-13 09:31:19 +0300
commit5517f3624d900882eee39b06c494223087326417 (patch)
tree80609c4997f8911188403f50489682a5750219eb /src/evict.c
parentfb140a1bff5a4fc3082e362f4b57030625193115 (diff)
downloadredis-5517f3624d900882eee39b06c494223087326417.tar.gz
Remove duplicate dbid lookup in performEvictions. (#9063)
Minor code cleanup.
Diffstat (limited to 'src/evict.c')
-rw-r--r--src/evict.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/evict.c b/src/evict.c
index 9f0aac1af..5fdcd4134 100644
--- a/src/evict.c
+++ b/src/evict.c
@@ -572,10 +572,10 @@ int performEvictions(void) {
bestdbid = pool[k].dbid;
if (server.maxmemory_policy & MAXMEMORY_FLAG_ALLKEYS) {
- de = dictFind(server.db[pool[k].dbid].dict,
+ de = dictFind(server.db[bestdbid].dict,
pool[k].key);
} else {
- de = dictFind(server.db[pool[k].dbid].expires,
+ de = dictFind(server.db[bestdbid].expires,
pool[k].key);
}