Take out the hack added in bug 47846 to deal with the fact that Equals() did

not work on mailnews urls.  It works fine now (see bug 98626).

Bug 182248, r=bienvenu. sr=darin
This commit is contained in:
bzbarsky%mit.edu 2002-12-03 20:19:18 +00:00
Родитель 278fe2a7ee
Коммит 229d7e68c8
2 изменённых файлов: 10 добавлений и 20 удалений

Просмотреть файл

@ -150,16 +150,16 @@ public:
MOZ_COUNT_CTOR(URLKey);
mHashValue = 0;
mURL->GetSpec(mSpec);
if (!mSpec.IsEmpty()) {
mHashValue = nsCRT::HashCode(mSpec.get());
nsCAutoString spec;
mURL->GetSpec(spec);
if (!spec.IsEmpty()) {
mHashValue = nsCRT::HashCode(spec.get());
}
}
URLKey(const URLKey& aKey)
: mURL(aKey.mURL),
mHashValue(aKey.mHashValue),
mSpec(aKey.mSpec)
mHashValue(aKey.mHashValue)
{
MOZ_COUNT_CTOR(URLKey);
}
@ -177,13 +177,9 @@ public:
virtual PRBool Equals(const nsHashKey* aKey) const
{
URLKey* key = (URLKey*)aKey;
#if 0 // bug 47846
PRBool equals = PR_FALSE;
nsresult result = mURL->Equals(key->mURL, &equals);
return (NS_SUCCEEDED(result) && equals);
#else
return (nsCRT::strcasecmp(mSpec.get(), key->mSpec.get()) == 0);
#endif
}
virtual nsHashKey *Clone(void) const
@ -193,7 +189,6 @@ public:
nsCOMPtr<nsIURI> mURL;
PRUint32 mHashValue;
nsSharableCString mSpec;
};
/*********************************************

Просмотреть файл

@ -150,16 +150,16 @@ public:
MOZ_COUNT_CTOR(URLKey);
mHashValue = 0;
mURL->GetSpec(mSpec);
if (!mSpec.IsEmpty()) {
mHashValue = nsCRT::HashCode(mSpec.get());
nsCAutoString spec;
mURL->GetSpec(spec);
if (!spec.IsEmpty()) {
mHashValue = nsCRT::HashCode(spec.get());
}
}
URLKey(const URLKey& aKey)
: mURL(aKey.mURL),
mHashValue(aKey.mHashValue),
mSpec(aKey.mSpec)
mHashValue(aKey.mHashValue)
{
MOZ_COUNT_CTOR(URLKey);
}
@ -177,13 +177,9 @@ public:
virtual PRBool Equals(const nsHashKey* aKey) const
{
URLKey* key = (URLKey*)aKey;
#if 0 // bug 47846
PRBool equals = PR_FALSE;
nsresult result = mURL->Equals(key->mURL, &equals);
return (NS_SUCCEEDED(result) && equals);
#else
return (nsCRT::strcasecmp(mSpec.get(), key->mSpec.get()) == 0);
#endif
}
virtual nsHashKey *Clone(void) const
@ -193,7 +189,6 @@ public:
nsCOMPtr<nsIURI> mURL;
PRUint32 mHashValue;
nsSharableCString mSpec;
};
/*********************************************