replace calculateKeySlot with known slot in evictionPoolPopulate (#12777)

This commit is contained in:
zhaozhao.zz 2023-11-17 19:01:06 +08:00 committed by GitHub
parent 6013122c8e
commit eb392c0a6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}