From eb392c0a6f247d507df07ca39386bf2b5d895424 Mon Sep 17 00:00:00 2001 From: "zhaozhao.zz" Date: Fri, 17 Nov 2023 19:01:06 +0800 Subject: [PATCH] replace calculateKeySlot with known slot in evictionPoolPopulate (#12777) --- src/evict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/evict.c b/src/evict.c index 754f918b2..a9d93c5b7 100644 --- a/src/evict.c +++ b/src/evict.c @@ -162,7 +162,7 @@ void evictionPoolPopulate(int dbid, int slot, dict *sampledict, redisDb *db, str * dictionary (but the expires one) we need to lookup the key * again in the key dictionary to obtain the value object. */ if (server.maxmemory_policy != MAXMEMORY_VOLATILE_TTL) { - if (!(server.maxmemory_policy & MAXMEMORY_FLAG_ALLKEYS)) de = dictFind(db->dict[calculateKeySlot(key)], key); + if (!(server.maxmemory_policy & MAXMEMORY_FLAG_ALLKEYS)) de = dictFind(db->dict[slot], key); o = dictGetVal(de); }