/* Return slot-specific dictionary for key based on key's hash slot in CME, or 0 in CMD.*/
/* Return slot-specific dictionary for key based on key's hash slot in CME, or 0 in CMD.*/
dict*getDict(redisDb*db,sdskey){
intgetKeySlot(sdskey){
if(server.current_client&&server.current_client->slot>=0){/* This is performance optimization, that uses pre-set slot id, in order to avoid calculating key hash. */
/* This is performance optimization, that uses pre-set slot id from the current command,
returndb->dict[server.current_client->slot];
* in order to avoid calculation of the key hash. Code paths that are using keys, that can be from different slots,
* MUST unset current client's slot value before calling any db functions, otherwise wrong dictionary can be used. */