Commit 99499264 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

wininet: Pass hash entry directly to URLCache_HashEntrySetUse rather than searching for it again.

parent 601b6835
...@@ -1193,15 +1193,10 @@ static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, stru ...@@ -1193,15 +1193,10 @@ static BOOL URLCache_FindHashW(LPCURLCACHE_HEADER pHeader, LPCWSTR lpszUrl, stru
* FALSE if the entry could not be found * FALSE if the entry could not be found
* *
*/ */
static BOOL URLCache_HashEntrySetUse(LPCURLCACHE_HEADER pHeader, LPCSTR lpszUrl, DWORD dwUseCount) static BOOL URLCache_HashEntrySetUse(struct _HASH_ENTRY * pHashEntry, DWORD dwUseCount)
{ {
struct _HASH_ENTRY * pHashEntry;
if (URLCache_FindHash(pHeader, lpszUrl, &pHashEntry))
{
pHashEntry->dwHashKey = dwUseCount | (DWORD)(pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES; pHashEntry->dwHashKey = dwUseCount | (DWORD)(pHashEntry->dwHashKey / HASHTABLE_NUM_ENTRIES) * HASHTABLE_NUM_ENTRIES;
return TRUE; return TRUE;
}
return FALSE;
} }
/*********************************************************************** /***********************************************************************
...@@ -1672,7 +1667,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA( ...@@ -1672,7 +1667,7 @@ BOOL WINAPI RetrieveUrlCacheEntryFileA(
pUrlEntry->dwHitRate++; pUrlEntry->dwHitRate++;
pUrlEntry->dwUseCount++; pUrlEntry->dwUseCount++;
URLCache_HashEntrySetUse(pHeader, lpszUrlName, pUrlEntry->dwUseCount); URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
if (!URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, FALSE)) if (!URLCache_CopyEntry(pContainer, pHeader, lpCacheEntryInfo, lpdwCacheEntryInfoBufferSize, pUrlEntry, FALSE))
{ {
...@@ -1764,7 +1759,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA( ...@@ -1764,7 +1759,7 @@ BOOL WINAPI UnlockUrlCacheEntryFileA(
return FALSE; return FALSE;
} }
pUrlEntry->dwUseCount--; pUrlEntry->dwUseCount--;
URLCache_HashEntrySetUse(pHeader, lpszUrlName, pUrlEntry->dwUseCount); URLCache_HashEntrySetUse(pHashEntry, pUrlEntry->dwUseCount);
URLCacheContainer_UnlockIndex(pContainer, pHeader); URLCacheContainer_UnlockIndex(pContainer, pHeader);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment