From 29caf2ccc31bc009d25b577cfc1cfbd82163aa3b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 8 Mar 2013 13:41:31 +0000 Subject: major speedup of clist nicer+ cache git-svn-id: http://svn.miranda-ng.org/main/trunk@3920 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/contact.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'plugins/Clist_nicer/src/contact.cpp') diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index 0bce13f2ae..d4a0188164 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -261,9 +261,8 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact return CompareString(LOCALE_USER_DEFAULT, NORM_IGNORECASE, namea, -1, nameb, -1) - 2; case SORTBY_LASTMSG: - if (c1->extraCacheEntry >= 0 && c1->extraCacheEntry < cfg::nextCacheEntry && - c2->extraCacheEntry >= 0 && c2->extraCacheEntry < cfg::nextCacheEntry) - return(cfg::eCache[c2->extraCacheEntry].dwLastMsgTime - cfg::eCache[c1->extraCacheEntry].dwLastMsgTime); + if (c1->pExtra && c2->pExtra) + return c2->pExtra->dwLastMsgTime - c1->pExtra->dwLastMsgTime; else { DWORD timestamp1 = INTSORT_GetLastMsgTime(c1->hContact); DWORD timestamp2 = INTSORT_GetLastMsgTime(c2->hContact); @@ -271,9 +270,8 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact } case SORTBY_FREQUENCY: - if ( c1->extraCacheEntry >= 0 && c1->extraCacheEntry < cfg::nextCacheEntry && - c2->extraCacheEntry >= 0 && c2->extraCacheEntry < cfg::nextCacheEntry ) - return(cfg::eCache[c1->extraCacheEntry].msgFrequency - cfg::eCache[c2->extraCacheEntry].msgFrequency); + if ( c1->pExtra && c2->pExtra) + return c1->pExtra->msgFrequency - c2->pExtra->msgFrequency; break; case SORTBY_PROTO: -- cgit v1.2.3