From da93b2228658a95f7f91a58bde9c5ed19f5e57d6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Apr 2018 13:22:15 +0300 Subject: these temporary variables aren't needed as well --- plugins/AVS/src/cache.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'plugins/AVS') diff --git a/plugins/AVS/src/cache.cpp b/plugins/AVS/src/cache.cpp index 33e6c877c3..11d8620b02 100644 --- a/plugins/AVS/src/cache.cpp +++ b/plugins/AVS/src/cache.cpp @@ -75,12 +75,8 @@ CacheNode* FindAvatarInCache(MCONTACT hContact, bool add, bool findAny) if (szProto == nullptr || !db_get_b(NULL, AVS_MODULE, szProto, 1)) return nullptr; - AVATARCACHEENTRY tmp; - tmp.hContact = hContact; - mir_cslock lck(cachecs); - - CacheNode *cc = arCache.find((CacheNode*)&tmp); + CacheNode *cc = arCache.find((CacheNode*)&hContact); if (cc) { cc->t_lastAccess = time(nullptr); return (cc->loaded || findAny) ? cc : nullptr; @@ -166,15 +162,14 @@ void DeleteAvatarFromCache(MCONTACT hContact, bool bForever) if (g_shutDown) return; - AVATARCACHEENTRY tmp; - tmp.hContact = GetContactThatHaveTheAvatar(hContact); + MCONTACT tmp = GetContactThatHaveTheAvatar(hContact); mir_cslock lck(cachecs); int idx = arCache.getIndex((CacheNode*)&tmp); if (idx == -1) { CacheNode temp_node; memset(&temp_node, 0, sizeof(temp_node)); - NotifyMetaAware(hContact, &temp_node, (AVATARCACHEENTRY *)GetProtoDefaultAvatar(hContact)); + NotifyMetaAware(hContact, &temp_node, (AVATARCACHEENTRY*)GetProtoDefaultAvatar(hContact)); } else { NotifyMetaAware(hContact, &arCache[idx], (AVATARCACHEENTRY*)GetProtoDefaultAvatar(hContact)); @@ -192,11 +187,8 @@ int SetAvatarAttribute(MCONTACT hContact, DWORD attrib, int mode) if (g_shutDown) return 0; - AVATARCACHEENTRY tmp; - tmp.hContact = hContact; - mir_cslock lck(cachecs); - CacheNode *cc = arCache.find((CacheNode*)&tmp); + CacheNode *cc = arCache.find((CacheNode*)&hContact); if (cc != nullptr) { DWORD dwFlags = cc->dwFlags; cc->dwFlags = mode ? (cc->dwFlags | attrib) : (cc->dwFlags & ~attrib); -- cgit v1.2.3