From cb52af13a359484773f112976fd7319a0975d73f Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Tue, 27 Mar 2007 08:34:59 -0700 Subject: [PATCH] Remove GetKeyPointer method from nsTHashtable key types. b=374906 r=bsmedberg --- accessible/src/base/nsAccessNode.h | 1 - caps/include/nsScriptSecurityManager.h | 5 ----- content/base/src/nsDOMAttributeMap.h | 1 - content/base/src/nsDocument.h | 1 - content/base/src/nsNameSpaceManager.cpp | 4 ---- content/html/content/src/nsHTMLFormElement.cpp | 1 - db/morkreader/nsMorkReader.h | 1 - extensions/cookie/nsPermissionManager.h | 5 ----- extensions/metrics/src/nsPtrHashKey.h | 1 - extensions/spellcheck/src/mozPersonalDictionary.h | 1 - gfx/src/os2/nsFontMetricsOS2.h | 2 +- gfx/thebes/public/gfxTextRunCache.h | 1 - gfx/thebes/src/gfxQuartzFontCache.h | 1 - js/src/xpconnect/tools/src/xpctools_private.h | 1 - modules/oji/src/ProxyJNI.cpp | 1 - netwerk/base/public/nsURIHashKey.h | 1 - netwerk/cookie/src/nsCookieService.h | 5 ----- toolkit/components/places/src/nsNavHistoryResult.h | 1 - xpcom/glue/nsHashKeys.h | 11 ----------- xpcom/glue/nsTHashtable.h | 3 --- xpcom/tests/TestHashtables.cpp | 1 - 21 files changed, 1 insertion(+), 48 deletions(-) diff --git a/accessible/src/base/nsAccessNode.h b/accessible/src/base/nsAccessNode.h index a672277dd8c..fb7bf285b2f 100755 --- a/accessible/src/base/nsAccessNode.h +++ b/accessible/src/base/nsAccessNode.h @@ -82,7 +82,6 @@ public: ~nsVoidHashKey() { } KeyType GetKey() const { return mValue; } - KeyTypePointer GetKeyPointer() const { return mValue; } PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mValue; } static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; } diff --git a/caps/include/nsScriptSecurityManager.h b/caps/include/nsScriptSecurityManager.h index aaac3bbfbbb..c5400a9208c 100644 --- a/caps/include/nsScriptSecurityManager.h +++ b/caps/include/nsScriptSecurityManager.h @@ -115,11 +115,6 @@ public: return mKey; } - KeyTypePointer GetKeyPointer() const - { - return mKey; - } - PRBool KeyEquals(KeyTypePointer aKey) const { PRBool eq; diff --git a/content/base/src/nsDOMAttributeMap.h b/content/base/src/nsDOMAttributeMap.h index 2a6cbde9639..c4f6075db73 100644 --- a/content/base/src/nsDOMAttributeMap.h +++ b/content/base/src/nsDOMAttributeMap.h @@ -92,7 +92,6 @@ public: ~nsAttrHashKey() {} KeyType GetKey() const { return mKey; } - KeyTypePointer GetKeyPointer() const { return &mKey; } PRBool KeyEquals(KeyTypePointer aKey) const { return mKey.mLocalName == aKey->mLocalName && diff --git a/content/base/src/nsDocument.h b/content/base/src/nsDocument.h index efc35e52f29..87c0adba77a 100644 --- a/content/base/src/nsDocument.h +++ b/content/base/src/nsDocument.h @@ -159,7 +159,6 @@ class nsUint32ToContentHashEntry : public PLDHashEntryHdr ~nsUint32ToContentHashEntry() { Destroy(); } KeyType GetKey() const { return mValue; } - KeyTypePointer GetKeyPointer() const { return &mValue; } PRBool KeyEquals(KeyTypePointer aKey) const { return mValue == *aKey; } diff --git a/content/base/src/nsNameSpaceManager.cpp b/content/base/src/nsNameSpaceManager.cpp index 551dfad8c40..7c6437c1028 100644 --- a/content/base/src/nsNameSpaceManager.cpp +++ b/content/base/src/nsNameSpaceManager.cpp @@ -92,10 +92,6 @@ public: { return mKey; } - KeyTypePointer GetKeyPointer() const - { - return mKey; - } PRBool KeyEquals(KeyType aKey) const { return mKey->Equals(*aKey); diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index bbdeac48b4b..d6780184feb 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -107,7 +107,6 @@ public: ~nsStringCaseInsensitiveHashKey() { } KeyType GetKey() const { return mStr; } - KeyTypePointer GetKeyPointer() const { return &mStr; } PRBool KeyEquals(const KeyTypePointer aKey) const { return mStr.Equals(*aKey,nsCaseInsensitiveStringComparator()); diff --git a/db/morkreader/nsMorkReader.h b/db/morkreader/nsMorkReader.h index 4a81f413275..130011be90a 100644 --- a/db/morkreader/nsMorkReader.h +++ b/db/morkreader/nsMorkReader.h @@ -84,7 +84,6 @@ class nsMorkReader ~IDKey() { } KeyType GetKey() const { return mStr; } - KeyTypePointer GetKeyPointer() const { return &mStr; } PRBool KeyEquals(const KeyTypePointer aKey) const { return mStr.Equals(*aKey); diff --git a/extensions/cookie/nsPermissionManager.h b/extensions/cookie/nsPermissionManager.h index 5a12b993841..38aaa8d13fc 100644 --- a/extensions/cookie/nsPermissionManager.h +++ b/extensions/cookie/nsPermissionManager.h @@ -83,11 +83,6 @@ public: return mHost; } - KeyTypePointer GetKeyPointer() const - { - return mHost; - } - PRBool KeyEquals(KeyTypePointer aKey) const { return !strcmp(mHost, aKey); diff --git a/extensions/metrics/src/nsPtrHashKey.h b/extensions/metrics/src/nsPtrHashKey.h index 66cf65b26ba..6f3bb7ed9c5 100644 --- a/extensions/metrics/src/nsPtrHashKey.h +++ b/extensions/metrics/src/nsPtrHashKey.h @@ -60,7 +60,6 @@ class nsPtrHashKey : public PLDHashEntryHdr ~nsPtrHashKey() {} KeyType GetKey() const { return mKey; } - KeyTypePointer GetKeyPointer() const { return mKey; } PRBool KeyEquals(KeyTypePointer key) const { return key == mKey; } diff --git a/extensions/spellcheck/src/mozPersonalDictionary.h b/extensions/spellcheck/src/mozPersonalDictionary.h index 5e06378e4ca..ff922b749f6 100644 --- a/extensions/spellcheck/src/mozPersonalDictionary.h +++ b/extensions/spellcheck/src/mozPersonalDictionary.h @@ -74,7 +74,6 @@ public: } KeyType GetKey() const { return mKey; } - KeyTypePointer GetKeyPointer() const { return mKey; } PRBool KeyEquals(KeyTypePointer aKey) const { return !nsCRT::strcmp(mKey, aKey); } static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; } diff --git a/gfx/src/os2/nsFontMetricsOS2.h b/gfx/src/os2/nsFontMetricsOS2.h index 61484b5ce90..05d1f65fda1 100644 --- a/gfx/src/os2/nsFontMetricsOS2.h +++ b/gfx/src/os2/nsFontMetricsOS2.h @@ -133,7 +133,7 @@ public: // Override, since we want to compare font names as case insensitive PRBool KeyEquals(const KeyTypePointer aKey) const { - return GetKeyPointer()->Equals(*aKey, nsCaseInsensitiveStringComparator()); + return GetKey().Equals(*aKey, nsCaseInsensitiveStringComparator()); } static PLDHashNumber HashKey(const KeyTypePointer aKey) { diff --git a/gfx/thebes/public/gfxTextRunCache.h b/gfx/thebes/public/gfxTextRunCache.h index 55e90b3addf..b66892a6af6 100644 --- a/gfx/thebes/public/gfxTextRunCache.h +++ b/gfx/thebes/public/gfxTextRunCache.h @@ -124,7 +124,6 @@ protected: ~FontGroupAndStringHashKeyT() { } KeyType GetKey() const { return mObj; } - KeyTypePointer GetKeyPointer() const { return &mObj; } PRBool KeyEquals(KeyTypePointer aKey) const { return diff --git a/gfx/thebes/src/gfxQuartzFontCache.h b/gfx/thebes/src/gfxQuartzFontCache.h index 39fbef729f7..9d5b551bdea 100644 --- a/gfx/thebes/src/gfxQuartzFontCache.h +++ b/gfx/thebes/src/gfxQuartzFontCache.h @@ -177,7 +177,6 @@ private: ~FontAndFamilyKey() { } KeyType GetKey() const { return mObj; } - KeyTypePointer GetKeyPointer() const { return &mObj; } PRBool KeyEquals(KeyTypePointer aKey) const { return diff --git a/js/src/xpconnect/tools/src/xpctools_private.h b/js/src/xpconnect/tools/src/xpctools_private.h index 12bfe2d9d2c..b3392e92034 100644 --- a/js/src/xpconnect/tools/src/xpctools_private.h +++ b/js/src/xpconnect/tools/src/xpctools_private.h @@ -163,7 +163,6 @@ public: ~FunctionKey() { } KeyType GetKey() const { return mF; } - KeyTypePointer GetKeyPointer() const { return &mF; } PRBool KeyEquals(const KeyTypePointer aKey) const { return mF == *aKey; diff --git a/modules/oji/src/ProxyJNI.cpp b/modules/oji/src/ProxyJNI.cpp index 49a75e35552..cde3cf2c94e 100644 --- a/modules/oji/src/ProxyJNI.cpp +++ b/modules/oji/src/ProxyJNI.cpp @@ -242,7 +242,6 @@ public: ~JavaClassMemberKey() { } KeyType GetKey() const { return mValue; } - KeyTypePointer GetKeyPointer() const { return &mValue; } PRBool KeyEquals(KeyTypePointer aKey) const { return aKey->clazz == mValue.clazz && aKey->memberID == mValue.memberID; } static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; } diff --git a/netwerk/base/public/nsURIHashKey.h b/netwerk/base/public/nsURIHashKey.h index 6792950736e..ade618662d7 100644 --- a/netwerk/base/public/nsURIHashKey.h +++ b/netwerk/base/public/nsURIHashKey.h @@ -59,7 +59,6 @@ public: ~nsURIHashKey() { MOZ_COUNT_DTOR(nsURIHashKey); } nsIURI* GetKey() const { return mKey; } - const nsIURI* GetKeyPointer() const { return mKey; } PRBool KeyEquals(const nsIURI* aKey) const { PRBool eq; diff --git a/netwerk/cookie/src/nsCookieService.h b/netwerk/cookie/src/nsCookieService.h index c75f3e5526c..45e29800510 100644 --- a/netwerk/cookie/src/nsCookieService.h +++ b/netwerk/cookie/src/nsCookieService.h @@ -108,11 +108,6 @@ class nsCookieEntry : public PLDHashEntryHdr return HostPtr(); } - KeyTypePointer GetKeyPointer() const - { - return HostPtr(); - } - PRBool KeyEquals(KeyTypePointer aKey) const { return !strcmp(HostPtr(), aKey); diff --git a/toolkit/components/places/src/nsNavHistoryResult.h b/toolkit/components/places/src/nsNavHistoryResult.h index 2e58da6ac8a..71c7f8f7a1b 100644 --- a/toolkit/components/places/src/nsNavHistoryResult.h +++ b/toolkit/components/places/src/nsNavHistoryResult.h @@ -79,7 +79,6 @@ public: ~nsTrimInt64HashKey() { } KeyType GetKey() const { return mValue; } - KeyTypePointer GetKeyPointer() const { return &mValue; } PRBool KeyEquals(KeyTypePointer aKey) const { return *aKey == mValue; } static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; } diff --git a/xpcom/glue/nsHashKeys.h b/xpcom/glue/nsHashKeys.h index bf444a1c39e..dc9381b490c 100644 --- a/xpcom/glue/nsHashKeys.h +++ b/xpcom/glue/nsHashKeys.h @@ -90,7 +90,6 @@ public: ~nsStringHashKey() { } KeyType GetKey() const { return mStr; } - KeyTypePointer GetKeyPointer() const { return &mStr; } PRBool KeyEquals(const KeyTypePointer aKey) const { return mStr.Equals(*aKey); @@ -123,7 +122,6 @@ public: ~nsCStringHashKey() { } KeyType GetKey() const { return mStr; } - KeyTypePointer GetKeyPointer() const { return &mStr; } PRBool KeyEquals(KeyTypePointer aKey) const { return mStr.Equals(*aKey); } @@ -154,7 +152,6 @@ public: ~nsUint32HashKey() { } KeyType GetKey() const { return mValue; } - KeyTypePointer GetKeyPointer() const { return &mValue; } PRBool KeyEquals(KeyTypePointer aKey) const { return *aKey == mValue; } static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; } @@ -183,7 +180,6 @@ public: ~nsISupportsHashKey() { } KeyType GetKey() const { return mSupports; } - KeyTypePointer GetKeyPointer() const { return mSupports; } PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mSupports; } @@ -216,7 +212,6 @@ public: ~nsVoidPtrHashKey() { } KeyType GetKey() const { return mKey; } - KeyTypePointer GetKeyPointer() const { return mKey; } PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mKey; } @@ -252,7 +247,6 @@ public: ~nsClearingVoidPtrHashKey() { mKey = NULL; } KeyType GetKey() const { return mKey; } - KeyTypePointer GetKeyPointer() const { return mKey; } PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mKey; } @@ -283,7 +277,6 @@ public: ~nsIDHashKey() { } KeyType GetKey() const { return mID; } - KeyTypePointer GetKeyPointer() const { return &mID; } PRBool KeyEquals(KeyTypePointer aKey) const { return aKey->Equals(mID); } @@ -316,7 +309,6 @@ public: ~nsDepCharHashKey() { } const char* GetKey() const { return mKey; } - const char* GetKeyPointer() const { return mKey; } PRBool KeyEquals(const char* aKey) const { return !strcmp(mKey, aKey); @@ -346,7 +338,6 @@ public: ~nsCharPtrHashKey() { if (mKey) free(NS_CONST_CAST(char *, mKey)); } const char* GetKey() const { return mKey; } - const char* GetKeyPointer() const { return mKey; } PRBool KeyEquals(KeyTypePointer aKey) const { return !strcmp(mKey, aKey); @@ -377,7 +368,6 @@ public: ~nsUnicharPtrHashKey() { if (mKey) NS_Free(NS_CONST_CAST(PRUnichar *, mKey)); } const PRUnichar* GetKey() const { return mKey; } - const PRUnichar* GetKeyPointer() const { return mKey; } PRBool KeyEquals(KeyTypePointer aKey) const { return !NS_strcmp(mKey, aKey); @@ -408,7 +398,6 @@ public: ~nsHashableHashKey() { } nsIHashable* GetKey() const { return mKey; } - const nsIHashable* GetKeyPointer() const { return mKey; } PRBool KeyEquals(const nsIHashable* aKey) const { PRBool eq; diff --git a/xpcom/glue/nsTHashtable.h b/xpcom/glue/nsTHashtable.h index 8aeec021546..566dedc353b 100644 --- a/xpcom/glue/nsTHashtable.h +++ b/xpcom/glue/nsTHashtable.h @@ -82,9 +82,6 @@ PL_DHashStubEnumRemove(PLDHashTable *table, * // the destructor must be defined... or you will cause link errors! * ~EntryType(); * - * // return the key of this entry - * const KeyTypePointer GetKeyPointer() const; - * * // KeyEquals(): does this entry match this key? * PRBool KeyEquals(KeyTypePointer aKey) const; * diff --git a/xpcom/tests/TestHashtables.cpp b/xpcom/tests/TestHashtables.cpp index 6ad7ce25b53..c284cc21161 100644 --- a/xpcom/tests/TestHashtables.cpp +++ b/xpcom/tests/TestHashtables.cpp @@ -103,7 +103,6 @@ public: EntityToUnicodeEntry(const EntityToUnicodeEntry& aEntry) { mNode = aEntry.mNode; } ~EntityToUnicodeEntry() { }; - const char* GetKeyPointer() const { return mNode->mStr; } PRBool KeyEquals(const char* aEntity) const { return !strcmp(mNode->mStr, aEntity); } static const char* KeyToPointer(const char* aEntity) { return aEntity; } static PLDHashNumber HashKey(const char* aEntity) { return HashString(aEntity); }