fixes bug 234608 "Removal of some deadcode in nsDiskCacheBinding" patch by alfredkayser@nl.ibm.com r=biesi sr=darin

This commit is contained in:
darin%meer.net 2004-06-22 15:56:49 +00:00
Родитель 5482e3d962
Коммит e672e7f3a6
2 изменённых файлов: 3 добавлений и 29 удалений

24
netwerk/cache/src/nsDiskCacheBinding.cpp поставляемый
Просмотреть файл

@ -266,30 +266,6 @@ nsDiskCacheBindery::FindActiveBinding(PRUint32 hashNumber)
}
/**
* FindBinding : to identify whether a record is 'in use' so we don't evict it
*/
nsDiskCacheBinding *
nsDiskCacheBindery::FindBinding(nsDiskCacheRecord * record)
{
NS_ASSERTION(initialized, "nsDiskCacheBindery not initialized");
// find hash entry for key
HashTableEntry * hashEntry;
hashEntry = (HashTableEntry *) PL_DHashTableOperate(&table, (void*) record->HashNumber(), PL_DHASH_LOOKUP);
if (PL_DHASH_ENTRY_IS_FREE(hashEntry)) return nsnull;
// walk list looking for matching record (match on MetaLocation)
NS_ASSERTION(hashEntry->mBinding, "hash entry left with no binding");
nsDiskCacheBinding * binding = hashEntry->mBinding;
while (binding->mRecord.MetaLocation() != record->MetaLocation()) {
binding = (nsDiskCacheBinding *)PR_NEXT_LINK(binding);
if (binding == hashEntry->mBinding) return nsnull;
}
return binding;
}
/**
* AddBinding
*

8
netwerk/cache/src/nsDiskCacheBinding.h поставляемый
Просмотреть файл

@ -125,17 +125,15 @@ public:
nsresult Init();
void Reset();
nsDiskCacheBinding * CreateBinding(nsCacheEntry * entry,
nsDiskCacheRecord * record);
nsDiskCacheBinding * CreateBinding(nsCacheEntry * entry,
nsDiskCacheRecord * record);
nsDiskCacheBinding * FindActiveBinding(PRUint32 hashNumber);
nsDiskCacheBinding * FindBinding(nsDiskCacheRecord * record);
nsresult AddBinding(nsDiskCacheBinding * binding);
void RemoveBinding(nsDiskCacheBinding * binding);
PRBool ActiveBindings();
private:
nsresult AddBinding(nsDiskCacheBinding * binding);
// member variables
static PLDHashTableOps ops;