Remove GetKeyPointer method from nsTHashtable key types. b=374906 r=bsmedberg
authordbaron@dbaron.org
Tue, 27 Mar 2007 08:34:59 -0700
changeset 151 83f2cdb4b479ff2c2468dccba6ab0c7cdfdf7fcf
parent 150 710aaee7ad28f0ec6497ff8fffa770b11db22ee7
child 152 8fdf8c5b52720217c0d442345d4b5635a54ff741
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs374906
milestone1.9a4pre
Remove GetKeyPointer method from nsTHashtable key types. b=374906 r=bsmedberg
accessible/src/base/nsAccessNode.h
caps/include/nsScriptSecurityManager.h
content/base/src/nsDOMAttributeMap.h
content/base/src/nsDocument.h
content/base/src/nsNameSpaceManager.cpp
content/html/content/src/nsHTMLFormElement.cpp
db/morkreader/nsMorkReader.h
extensions/cookie/nsPermissionManager.h
extensions/metrics/src/nsPtrHashKey.h
extensions/spellcheck/src/mozPersonalDictionary.h
gfx/src/os2/nsFontMetricsOS2.h
gfx/thebes/public/gfxTextRunCache.h
gfx/thebes/src/gfxQuartzFontCache.h
js/src/xpconnect/tools/src/xpctools_private.h
modules/oji/src/ProxyJNI.cpp
netwerk/base/public/nsURIHashKey.h
netwerk/cookie/src/nsCookieService.h
toolkit/components/places/src/nsNavHistoryResult.h
xpcom/glue/nsHashKeys.h
xpcom/glue/nsTHashtable.h
xpcom/tests/TestHashtables.cpp
--- a/accessible/src/base/nsAccessNode.h
+++ b/accessible/src/base/nsAccessNode.h
@@ -77,17 +77,16 @@ public:
   typedef const void* KeyType;
   typedef const void* KeyTypePointer;
   
   nsVoidHashKey(KeyTypePointer aKey) : mValue(aKey) { }
   nsVoidHashKey(const nsVoidHashKey& toCopy) : mValue(toCopy.mValue) { }
   ~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; }
   static PLDHashNumber HashKey(KeyTypePointer aKey) { return NS_PTR_TO_INT32(aKey) >> 2; }
   enum { ALLOW_MEMMOVE = PR_TRUE };
 
 private:
   const void* mValue;
--- a/caps/include/nsScriptSecurityManager.h
+++ b/caps/include/nsScriptSecurityManager.h
@@ -110,21 +110,16 @@ public:
     {
     }
 
     KeyType GetKey() const
     {
         return mKey;
     }
 
-    KeyTypePointer GetKeyPointer() const
-    {
-        return mKey;
-    }
-
     PRBool KeyEquals(KeyTypePointer aKey) const
     {
         PRBool eq;
         mKey->Equals(NS_CONST_CAST(nsIPrincipal*, aKey),
                      &eq);
         return eq;
     }
 
--- a/content/base/src/nsDOMAttributeMap.h
+++ b/content/base/src/nsDOMAttributeMap.h
@@ -87,17 +87,16 @@ public:
   typedef const nsAttrKey& KeyType;
   typedef const nsAttrKey* KeyTypePointer;
 
   nsAttrHashKey(KeyTypePointer aKey) : mKey(*aKey) {}
   nsAttrHashKey(const nsAttrHashKey& aCopy) : mKey(aCopy.mKey) {}
   ~nsAttrHashKey() {}
 
   KeyType GetKey() const { return mKey; }
-  KeyTypePointer GetKeyPointer() const { return &mKey; }
   PRBool KeyEquals(KeyTypePointer aKey) const
     {
       return mKey.mLocalName == aKey->mLocalName &&
              mKey.mNamespaceID == aKey->mNamespaceID;
     }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey)
--- a/content/base/src/nsDocument.h
+++ b/content/base/src/nsDocument.h
@@ -154,17 +154,16 @@ class nsUint32ToContentHashEntry : publi
       // effectively stealing it. If toCopy is destroyed right after this,
       // we'll be OK.
       NS_CONST_CAST(nsUint32ToContentHashEntry&, toCopy).mValOrHash = nsnull;
       NS_ERROR("Copying not supported. Fasten your seat belt.");
     }
     ~nsUint32ToContentHashEntry() { Destroy(); }
 
     KeyType GetKey() const { return mValue; }
-    KeyTypePointer GetKeyPointer() const { return &mValue; }
 
     PRBool KeyEquals(KeyTypePointer aKey) const { return mValue == *aKey; }
 
     static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
     static PLDHashNumber HashKey(KeyTypePointer aKey) { return *aKey; }
     enum { ALLOW_MEMMOVE = PR_TRUE };
 
     // Content set methods
--- a/content/base/src/nsNameSpaceManager.cpp
+++ b/content/base/src/nsNameSpaceManager.cpp
@@ -87,20 +87,16 @@ public:
   nsNameSpaceKey(const nsNameSpaceKey& toCopy) : mKey(toCopy.mKey)
   {
   }
 
   KeyType GetKey() const
   {
     return mKey;
   }
-  KeyTypePointer GetKeyPointer() const
-  {
-    return mKey;
-  }
   PRBool KeyEquals(KeyType aKey) const
   {
     return mKey->Equals(*aKey);
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey)
   {
     return aKey;
--- a/content/html/content/src/nsHTMLFormElement.cpp
+++ b/content/html/content/src/nsHTMLFormElement.cpp
@@ -102,17 +102,16 @@ class nsStringCaseInsensitiveHashKey : p
 public:
   typedef const nsAString& KeyType;
   typedef const nsAString* KeyTypePointer;
   nsStringCaseInsensitiveHashKey(KeyTypePointer aStr) : mStr(*aStr) { } //take it easy just deal HashKey 
   nsStringCaseInsensitiveHashKey(const nsStringCaseInsensitiveHashKey& toCopy) : mStr(toCopy.mStr) { }
   ~nsStringCaseInsensitiveHashKey() { }
 
   KeyType GetKey() const { return mStr; }
-  KeyTypePointer GetKeyPointer() const { return &mStr; }
   PRBool KeyEquals(const KeyTypePointer aKey) const
   {
     return mStr.Equals(*aKey,nsCaseInsensitiveStringComparator());
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
   static PLDHashNumber HashKey(const KeyTypePointer aKey)
   {
--- a/db/morkreader/nsMorkReader.h
+++ b/db/morkreader/nsMorkReader.h
@@ -79,17 +79,16 @@ class nsMorkReader
     typedef const nsCSubstring& KeyType;
     typedef const nsCSubstring* KeyTypePointer;
 
     IDKey(KeyTypePointer aStr) : mStr(*aStr) { }
     IDKey(const IDKey& toCopy) : mStr(toCopy.mStr) { }
     ~IDKey() { }
 
     KeyType GetKey() const { return mStr; }
-    KeyTypePointer GetKeyPointer() const { return &mStr; }
     PRBool KeyEquals(const KeyTypePointer aKey) const
     {
       return mStr.Equals(*aKey);
     }
 
     static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
     static PLDHashNumber HashKey(const KeyTypePointer aKey)
     {
--- a/extensions/cookie/nsPermissionManager.h
+++ b/extensions/cookie/nsPermissionManager.h
@@ -78,21 +78,16 @@ public:
   {
   }
 
   KeyType GetKey() const
   {
     return mHost;
   }
 
-  KeyTypePointer GetKeyPointer() const
-  {
-    return mHost;
-  }
-
   PRBool KeyEquals(KeyTypePointer aKey) const
   {
     return !strcmp(mHost, aKey);
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey)
   {
     return aKey;
--- a/extensions/metrics/src/nsPtrHashKey.h
+++ b/extensions/metrics/src/nsPtrHashKey.h
@@ -55,17 +55,16 @@ class nsPtrHashKey : public PLDHashEntry
   typedef const T *KeyType;
   typedef const T *KeyTypePointer;
 
   nsPtrHashKey(const T *key) : mKey(key) {}
   nsPtrHashKey(const nsPtrHashKey<T> &toCopy) : mKey(toCopy.mKey) {}
   ~nsPtrHashKey() {}
 
   KeyType GetKey() const { return mKey; }
-  KeyTypePointer GetKeyPointer() const { return mKey; }
 
   PRBool KeyEquals(KeyTypePointer key) const { return key == mKey; }
 
   static KeyTypePointer KeyToPointer(KeyType key) { return key; }
   static PLDHashNumber HashKey(KeyTypePointer key)
   {
     return NS_PTR_TO_INT32(key) >> 2;
   }
--- a/extensions/spellcheck/src/mozPersonalDictionary.h
+++ b/extensions/spellcheck/src/mozPersonalDictionary.h
@@ -69,17 +69,16 @@ public:
 
   ~nsUniCharEntry()
   { 
     if (mKey)
       nsCRT::free(mKey);
   }
  
   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; }
 
   static PLDHashNumber HashKey(KeyTypePointer aKey) { return nsCRT::HashCode(aKey); }
 
   enum { ALLOW_MEMMOVE = PR_TRUE };
 
 private:
--- a/gfx/src/os2/nsFontMetricsOS2.h
+++ b/gfx/src/os2/nsFontMetricsOS2.h
@@ -128,17 +128,17 @@ public:
       nsMemory::Free(mRepresentableCharMap);
     }
 #endif
   }
 
   // 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)
   {
     nsAutoString low(*aKey);
     ToLowerCase(low);
     return HashString(low);
   }
 
--- a/gfx/thebes/public/gfxTextRunCache.h
+++ b/gfx/thebes/public/gfxTextRunCache.h
@@ -119,17 +119,16 @@ protected:
         typedef const T& KeyType;
         typedef const T* KeyTypePointer;
 
         FontGroupAndStringHashKeyT(KeyTypePointer aObj) : mObj(*aObj) { }
         FontGroupAndStringHashKeyT(const FontGroupAndStringHashKeyT<T>& other) : mObj(other.mObj) { }
         ~FontGroupAndStringHashKeyT() { }
 
         KeyType GetKey() const { return mObj; }
-        KeyTypePointer GetKeyPointer() const { return &mObj; }
 
         PRBool KeyEquals(KeyTypePointer aKey) const {
             return
                 mObj.mString->Equals(*(aKey->mString)) &&
                 mObj.mFontGroup->Equals(*(aKey->mFontGroup.get()));
         }
 
         static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
--- a/gfx/thebes/src/gfxQuartzFontCache.h
+++ b/gfx/thebes/src/gfxQuartzFontCache.h
@@ -172,17 +172,16 @@ private:
         typedef const FontAndFamilyContainer& KeyType;
         typedef const FontAndFamilyContainer* KeyTypePointer;
 
         FontAndFamilyKey(KeyTypePointer aObj) : mObj(*aObj) { }
         FontAndFamilyKey(const FontAndFamilyKey& other) : mObj(other.mObj) { }
         ~FontAndFamilyKey() { }
 
         KeyType GetKey() const { return mObj; }
-        KeyTypePointer GetKeyPointer() const { return &mObj; }
 
         PRBool KeyEquals(KeyTypePointer aKey) const {
             return
                 aKey->mFamily.Equals(mObj.mFamily) &&
                 aKey->mStyle.Equals(mObj.mStyle);
         }
 
         static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
--- a/js/src/xpconnect/tools/src/xpctools_private.h
+++ b/js/src/xpconnect/tools/src/xpctools_private.h
@@ -158,17 +158,16 @@ public:
     typedef const FunctionID &KeyType;
     typedef const FunctionID *KeyTypePointer;
 
     FunctionKey(KeyTypePointer aF) : mF(*aF) { }
     FunctionKey(const FunctionKey &toCopy) : mF(toCopy.mF) { }
     ~FunctionKey() { }
 
     KeyType GetKey() const { return mF; }
-    KeyTypePointer GetKeyPointer() const { return &mF; }
     PRBool KeyEquals(const KeyTypePointer aKey) const
     {
         return mF == *aKey;
     }
 
     static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
     static PLDHashNumber HashKey(const KeyTypePointer aKey) {
         return (aKey->lineno * 17) | (aKey->extent * 7);
--- a/modules/oji/src/ProxyJNI.cpp
+++ b/modules/oji/src/ProxyJNI.cpp
@@ -237,17 +237,16 @@ public:
   typedef const JavaClassMember& KeyType;
   typedef const JavaClassMember* KeyTypePointer;
   
   JavaClassMemberKey(KeyTypePointer aKey) : mValue(*aKey) { }
   JavaClassMemberKey(const JavaClassMemberKey& toCopy) : mValue(toCopy.mValue) { }
   ~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; }
   static PLDHashNumber HashKey(KeyTypePointer aKey) 
   { 
     PRUint32 v1 = NS_PTR_TO_INT32(aKey->clazz);
     PRUint32 v2 = NS_PTR_TO_INT32(aKey->memberID);
     return v1 ^ v2;
--- a/netwerk/base/public/nsURIHashKey.h
+++ b/netwerk/base/public/nsURIHashKey.h
@@ -54,17 +54,16 @@ public:
 
     nsURIHashKey(const nsIURI* aKey) :
         mKey(NS_CONST_CAST(nsIURI*, aKey)) { MOZ_COUNT_CTOR(nsURIHashKey); }
     nsURIHashKey(const nsURIHashKey& toCopy) :
         mKey(toCopy.mKey) { MOZ_COUNT_CTOR(nsURIHashKey); }
     ~nsURIHashKey() { MOZ_COUNT_DTOR(nsURIHashKey); }
 
     nsIURI* GetKey() const { return mKey; }
-    const nsIURI* GetKeyPointer() const { return mKey; }
 
     PRBool KeyEquals(const nsIURI* aKey) const {
         PRBool eq;
         if (NS_SUCCEEDED(mKey->Equals(NS_CONST_CAST(nsIURI*,aKey), &eq))) {
             return eq;
         }
         return PR_FALSE;
     }
--- a/netwerk/cookie/src/nsCookieService.h
+++ b/netwerk/cookie/src/nsCookieService.h
@@ -103,21 +103,16 @@ class nsCookieEntry : public PLDHashEntr
       } while ((current = next));
     }
 
     KeyType GetKey() const
     {
       return HostPtr();
     }
 
-    KeyTypePointer GetKeyPointer() const
-    {
-      return HostPtr();
-    }
-
     PRBool KeyEquals(KeyTypePointer aKey) const
     {
       return !strcmp(HostPtr(), aKey);
     }
 
     static KeyTypePointer KeyToPointer(KeyType aKey)
     {
       return aKey;
--- a/toolkit/components/places/src/nsNavHistoryResult.h
+++ b/toolkit/components/places/src/nsNavHistoryResult.h
@@ -74,17 +74,16 @@ public:
   typedef const PRInt64& KeyType;
   typedef const PRInt64* KeyTypePointer;
 
   nsTrimInt64HashKey(KeyTypePointer aKey) : mValue(*aKey) { }
   nsTrimInt64HashKey(const nsTrimInt64HashKey& toCopy) : mValue(toCopy.mValue) { }
   ~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; }
   static PLDHashNumber HashKey(KeyTypePointer aKey)
     { return NS_STATIC_CAST(PRUint32, (*aKey) & PR_UINT32_MAX); }
   enum { ALLOW_MEMMOVE = PR_TRUE };
 
 private:
--- a/xpcom/glue/nsHashKeys.h
+++ b/xpcom/glue/nsHashKeys.h
@@ -85,17 +85,16 @@ public:
   typedef const nsAString& KeyType;
   typedef const nsAString* KeyTypePointer;
 
   nsStringHashKey(KeyTypePointer aStr) : mStr(*aStr) { }
   nsStringHashKey(const nsStringHashKey& toCopy) : mStr(toCopy.mStr) { }
   ~nsStringHashKey() { }
 
   KeyType GetKey() const { return mStr; }
-  KeyTypePointer GetKeyPointer() const { return &mStr; }
   PRBool KeyEquals(const KeyTypePointer aKey) const
   {
     return mStr.Equals(*aKey);
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
   static PLDHashNumber HashKey(const KeyTypePointer aKey)
   {
@@ -118,17 +117,16 @@ public:
   typedef const nsACString& KeyType;
   typedef const nsACString* KeyTypePointer;
   
   nsCStringHashKey(const nsACString* aStr) : mStr(*aStr) { }
   nsCStringHashKey(const nsCStringHashKey& toCopy) : mStr(toCopy.mStr) { }
   ~nsCStringHashKey() { }
 
   KeyType GetKey() const { return mStr; }
-  KeyTypePointer GetKeyPointer() const { return &mStr; }
 
   PRBool KeyEquals(KeyTypePointer aKey) const { return mStr.Equals(*aKey); }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey)
   {
     return HashString(*aKey);
   }
@@ -149,17 +147,16 @@ public:
   typedef const PRUint32& KeyType;
   typedef const PRUint32* KeyTypePointer;
   
   nsUint32HashKey(KeyTypePointer aKey) : mValue(*aKey) { }
   nsUint32HashKey(const nsUint32HashKey& toCopy) : mValue(toCopy.mValue) { }
   ~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; }
   static PLDHashNumber HashKey(KeyTypePointer aKey) { return *aKey; }
   enum { ALLOW_MEMMOVE = PR_TRUE };
 
 private:
   const PRUint32 mValue;
@@ -178,17 +175,16 @@ public:
 
   nsISupportsHashKey(const nsISupports* key) :
     mSupports(NS_CONST_CAST(nsISupports*,key)) { }
   nsISupportsHashKey(const nsISupportsHashKey& toCopy) :
     mSupports(toCopy.mSupports) { }
   ~nsISupportsHashKey() { }
 
   KeyType GetKey() const { return mSupports; }
-  KeyTypePointer GetKeyPointer() const { return mSupports; }
   
   PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mSupports; }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey)
   {
     return NS_PTR_TO_INT32(aKey) >>2;
   }
@@ -211,17 +207,16 @@ public:
 
   nsVoidPtrHashKey(const void* key) :
     mKey(key) { }
   nsVoidPtrHashKey(const nsVoidPtrHashKey& toCopy) :
     mKey(toCopy.mKey) { }
   ~nsVoidPtrHashKey() { }
 
   KeyType GetKey() const { return mKey; }
-  KeyTypePointer GetKeyPointer() const { return mKey; }
   
   PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mKey; }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey)
   {
     return NS_PTR_TO_INT32(aKey) >>2;
   }
@@ -247,17 +242,16 @@ public:
 
   nsClearingVoidPtrHashKey(const void* key) :
     mKey(key) { }
   nsClearingVoidPtrHashKey(const nsClearingVoidPtrHashKey& toCopy) :
     mKey(toCopy.mKey) { }
   ~nsClearingVoidPtrHashKey() { mKey = NULL; }
 
   KeyType GetKey() const { return mKey; }
-  KeyTypePointer GetKeyPointer() const { return mKey; }
   
   PRBool KeyEquals(KeyTypePointer aKey) const { return aKey == mKey; }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey)
   {
     return NS_PTR_TO_INT32(aKey) >>2;
   }
@@ -278,17 +272,16 @@ public:
   typedef const nsID& KeyType;
   typedef const nsID* KeyTypePointer;
   
   nsIDHashKey(const nsID* inID) : mID(*inID) { }
   nsIDHashKey(const nsIDHashKey& toCopy) : mID(toCopy.mID) { }
   ~nsIDHashKey() { }
 
   KeyType GetKey() const { return mID; }
-  KeyTypePointer GetKeyPointer() const { return &mID; }
 
   PRBool KeyEquals(KeyTypePointer aKey) const { return aKey->Equals(mID); }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return &aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey);
   enum { ALLOW_MEMMOVE = PR_TRUE };
 
 private:
@@ -311,17 +304,16 @@ public:
   typedef const char* KeyType;
   typedef const char* KeyTypePointer;
 
   nsDepCharHashKey(const char* aKey) { mKey = aKey; }
   nsDepCharHashKey(const nsDepCharHashKey& toCopy) { mKey = toCopy.mKey; }
   ~nsDepCharHashKey() { }
 
   const char* GetKey() const { return mKey; }
-  const char* GetKeyPointer() const { return mKey; }
   PRBool KeyEquals(const char* aKey) const
   {
     return !strcmp(mKey, aKey);
   }
 
   static const char* KeyToPointer(const char* aKey) { return aKey; }
   static PLDHashNumber HashKey(const char* aKey) { return HashString(aKey); }
   enum { ALLOW_MEMMOVE = PR_TRUE };
@@ -341,17 +333,16 @@ public:
   typedef const char* KeyType;
   typedef const char* KeyTypePointer;
 
   nsCharPtrHashKey(const char* aKey) : mKey(strdup(aKey)) { }
   nsCharPtrHashKey(const nsCharPtrHashKey& toCopy) : mKey(strdup(toCopy.mKey)) { }
   ~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);
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey) { return HashString(aKey); }
 
@@ -372,17 +363,16 @@ public:
   typedef const PRUnichar* KeyType;
   typedef const PRUnichar* KeyTypePointer;
 
   nsUnicharPtrHashKey(const PRUnichar* aKey) : mKey(NS_strdup(aKey)) { }
   nsUnicharPtrHashKey(const nsUnicharPtrHashKey& toCopy) : mKey(NS_strdup(toCopy.mKey)) { }
   ~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);
   }
 
   static KeyTypePointer KeyToPointer(KeyType aKey) { return aKey; }
   static PLDHashNumber HashKey(KeyTypePointer aKey) { return HashString(aKey); }
 
@@ -403,17 +393,16 @@ public:
 
     nsHashableHashKey(const nsIHashable* aKey) :
         mKey(NS_CONST_CAST(nsIHashable*, aKey)) { }
     nsHashableHashKey(const nsHashableHashKey& toCopy) :
         mKey(toCopy.mKey) { }
     ~nsHashableHashKey() { }
 
     nsIHashable* GetKey() const { return mKey; }
-    const nsIHashable* GetKeyPointer() const { return mKey; }
 
     PRBool KeyEquals(const nsIHashable* aKey) const {
         PRBool eq;
         if (NS_SUCCEEDED(mKey->Equals(NS_CONST_CAST(nsIHashable*,aKey), &eq))) {
             return eq;
         }
         return PR_FALSE;
     }
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -77,19 +77,16 @@ PL_DHashStubEnumRemove(PLDHashTable    *
  *
  *     // the copy constructor must be defined, even if AllowMemMove() == true
  *     // or you will cause link errors!
  *     EntryType(const EntryType& aEnt);
  *
  *     // 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;
  *
  *     // KeyToPointer(): Convert KeyType to KeyTypePointer
  *     static KeyTypePointer KeyToPointer(KeyType aKey);
  *
  *     // HashKey(): calculate the hash number
  *     static PLDHashNumber HashKey(KeyTypePointer aKey);
--- a/xpcom/tests/TestHashtables.cpp
+++ b/xpcom/tests/TestHashtables.cpp
@@ -98,17 +98,16 @@ class EntityToUnicodeEntry : public PLDH
 public:
   typedef const char* KeyType;
   typedef const char* KeyTypePointer;
 
   EntityToUnicodeEntry(const char* aKey) { mNode = nsnull; }
   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); }
   enum { ALLOW_MEMMOVE = PR_TRUE };
 
   const EntityNode* mNode;
 };