mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 00:52:38 +00:00
Rename redis_member2struct ro server_member2struct (#166)
part of #144 Signed-off-by: 0del <bany.y0599@gmail.com>
This commit is contained in:
parent
69d28be0f1
commit
def09488aa
@ -390,7 +390,7 @@ void touchWatchedKey(serverDb *db, robj *key) {
|
|||||||
/* Check if we are already watching for this key */
|
/* Check if we are already watching for this key */
|
||||||
listRewind(clients,&li);
|
listRewind(clients,&li);
|
||||||
while((ln = listNext(&li))) {
|
while((ln = listNext(&li))) {
|
||||||
watchedKey *wk = redis_member2struct(watchedKey, node, ln);
|
watchedKey *wk = server_member2struct(watchedKey, node, ln);
|
||||||
client *c = wk->client;
|
client *c = wk->client;
|
||||||
|
|
||||||
if (wk->expired) {
|
if (wk->expired) {
|
||||||
@ -443,7 +443,7 @@ void touchAllWatchedKeysInDb(serverDb *emptied, serverDb *replaced_with) {
|
|||||||
if (!clients) continue;
|
if (!clients) continue;
|
||||||
listRewind(clients,&li);
|
listRewind(clients,&li);
|
||||||
while((ln = listNext(&li))) {
|
while((ln = listNext(&li))) {
|
||||||
watchedKey *wk = redis_member2struct(watchedKey, node, ln);
|
watchedKey *wk = server_member2struct(watchedKey, node, ln);
|
||||||
if (wk->expired) {
|
if (wk->expired) {
|
||||||
if (!replaced_with || !dbFind(replaced_with, key->ptr)) {
|
if (!replaced_with || !dbFind(replaced_with, key->ptr)) {
|
||||||
/* Expired key now deleted. No logical change. Clear the
|
/* Expired key now deleted. No logical change. Clear the
|
||||||
|
@ -103,7 +103,7 @@ struct hdr_histogram;
|
|||||||
#define max(a, b) ((a) > (b) ? (a) : (b))
|
#define max(a, b) ((a) > (b) ? (a) : (b))
|
||||||
|
|
||||||
/* Get the pointer of the outer struct from a member address */
|
/* Get the pointer of the outer struct from a member address */
|
||||||
#define redis_member2struct(struct_name, member_name, member_addr) \
|
#define server_member2struct(struct_name, member_name, member_addr) \
|
||||||
((struct_name *)((char*)member_addr - offsetof(struct_name, member_name)))
|
((struct_name *)((char*)member_addr - offsetof(struct_name, member_name)))
|
||||||
|
|
||||||
/* Error codes */
|
/* Error codes */
|
||||||
|
Loading…
Reference in New Issue
Block a user