From 229d7e68c8cd7bd35e43bbe09ea1704f85f783e3 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Tue, 3 Dec 2002 20:19:18 +0000 Subject: [PATCH] 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 --- content/html/style/src/nsCSSLoader.cpp | 15 +++++---------- layout/style/nsCSSLoader.cpp | 15 +++++---------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/content/html/style/src/nsCSSLoader.cpp b/content/html/style/src/nsCSSLoader.cpp index cec3972d1228..8debfdbe0787 100644 --- a/content/html/style/src/nsCSSLoader.cpp +++ b/content/html/style/src/nsCSSLoader.cpp @@ -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 mURL; PRUint32 mHashValue; - nsSharableCString mSpec; }; /********************************************* diff --git a/layout/style/nsCSSLoader.cpp b/layout/style/nsCSSLoader.cpp index cec3972d1228..8debfdbe0787 100644 --- a/layout/style/nsCSSLoader.cpp +++ b/layout/style/nsCSSLoader.cpp @@ -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 mURL; PRUint32 mHashValue; - nsSharableCString mSpec; }; /*********************************************