diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-08 13:41:31 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-08 13:41:31 +0000 |
commit | 29caf2ccc31bc009d25b577cfc1cfbd82163aa3b (patch) | |
tree | d4122345850eaf1c2bbf4fce285bc63b5ffd937d /plugins/Clist_nicer/src/contact.cpp | |
parent | c4c02e49eddd09393cafb55513f5067b5810c1c9 (diff) |
major speedup of clist nicer+ cache
git-svn-id: http://svn.miranda-ng.org/main/trunk@3920 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src/contact.cpp')
-rw-r--r-- | plugins/Clist_nicer/src/contact.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
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:
|