Rename redis_member2struct ro server_member2struct (#166)

part of #144

Signed-off-by: 0del <bany.y0599@gmail.com>
This commit is contained in:
0del 2024-04-03 16:07:28 +07:00 committed by GitHub
parent 69d28be0f1
commit def09488aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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 */