Remove GetKey callbacks from nsDoubleHashtable users. b=374906 r=bsmedberg
authordbaron@dbaron.org
Tue, 27 Mar 2007 08:34:14 -0700
changeset 150 710aaee7ad28f0ec6497ff8fffa770b11db22ee7
parent 149 aec4549c91defbb33656b4c9e181a4bae7d551c7
child 151 83f2cdb4b479ff2c2468dccba6ab0c7cdfdf7fcf
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs374906
milestone1.9a4pre
Remove GetKey callbacks from nsDoubleHashtable users. b=374906 r=bsmedberg
content/xslt/src/xslt/txKey.h
content/xslt/src/xslt/txKeyFunctionCall.cpp
xpcom/ds/nsDoubleHashtable.h
--- a/content/xslt/src/xslt/txKey.h
+++ b/content/xslt/src/xslt/txKey.h
@@ -70,17 +70,16 @@ struct txKeyValueHashEntry : public PLDH
 {
     txKeyValueHashEntry(const void* aKey)
         : mKey(*NS_STATIC_CAST(const txKeyValueHashKey*, aKey)),
           mNodeSet(new txNodeSet(nsnull))
     {
     }
 
     // @see nsDoubleHashtable.h
-    const void* GetKey();
     PRBool MatchEntry(const void* aKey) const;
     static PLDHashNumber HashKey(const void* aKey);
     
     txKeyValueHashKey mKey;
     nsRefPtr<txNodeSet> mNodeSet;
 };
 
 DECL_DHASH_WRAPPER(txKeyValueHash, txKeyValueHashEntry, txKeyValueHashKey&)
@@ -103,17 +102,16 @@ struct txIndexedKeyHashEntry : public PL
 {
     txIndexedKeyHashEntry(const void* aKey)
         : mKey(*NS_STATIC_CAST(const txIndexedKeyHashKey*, aKey)),
           mIndexed(PR_FALSE)
     {
     }
 
     // @see nsDoubleHashtable.h
-    const void* GetKey();
     PRBool MatchEntry(const void* aKey) const;
     static PLDHashNumber HashKey(const void* aKey);
 
     txIndexedKeyHashKey mKey;
     PRBool mIndexed;
 };
 
 DECL_DHASH_WRAPPER(txIndexedKeyHash, txIndexedKeyHashEntry,
--- a/content/xslt/src/xslt/txKeyFunctionCall.cpp
+++ b/content/xslt/src/xslt/txKeyFunctionCall.cpp
@@ -150,22 +150,16 @@ txKeyFunctionCall::getNameAtom(nsIAtom**
 
 /**
  * Hash functions
  */
 
 DHASH_WRAPPER(txKeyValueHash, txKeyValueHashEntry, txKeyValueHashKey&)
 DHASH_WRAPPER(txIndexedKeyHash, txIndexedKeyHashEntry, txIndexedKeyHashKey&)
 
-const void*
-txKeyValueHashEntry::GetKey()
-{
-    return &mKey;
-}
-
 PRBool
 txKeyValueHashEntry::MatchEntry(const void* aKey) const
 {
     const txKeyValueHashKey* key =
         NS_STATIC_CAST(const txKeyValueHashKey*, aKey);
 
     return mKey.mKeyName == key->mKeyName &&
            mKey.mRootIdentifier == key->mRootIdentifier &&
@@ -179,22 +173,16 @@ txKeyValueHashEntry::HashKey(const void*
         NS_STATIC_CAST(const txKeyValueHashKey*, aKey);
 
     return key->mKeyName.mNamespaceID ^
            NS_PTR_TO_INT32(key->mKeyName.mLocalName.get()) ^
            key->mRootIdentifier ^
            HashString(key->mKeyValue);
 }
 
-const void*
-txIndexedKeyHashEntry::GetKey()
-{
-    return &mKey;
-}
-
 PRBool
 txIndexedKeyHashEntry::MatchEntry(const void* aKey) const
 {
     const txIndexedKeyHashKey* key =
         NS_STATIC_CAST(const txIndexedKeyHashKey*, aKey);
 
     return mKey.mKeyName == key->mKeyName &&
            mKey.mRootIdentifier == key->mRootIdentifier;
--- a/xpcom/ds/nsDoubleHashtable.h
+++ b/xpcom/ds/nsDoubleHashtable.h
@@ -162,19 +162,16 @@
  * for you except the constructor and destructor):
  *
  * CONSTRUCTOR(const void* aKey)
  * When your entry is constructed it will only be given a pointer to the key.
  *
  * DESTRUCTOR
  * Called when the entry is destroyed (of course).
  *
- * const void* GetKey()
- * Must return a pointer to the key
- *
  * PRBool MatchEntry(const void* aKey) - return true or false depending on
  *        whether the key pointed to by aKey matches this entry
  *
  * static PLDHashNumber HashKey(const void* aKey) - get a hashcode based on the
  *        key (must be the same every time for the same key, but does not have
  *        to be unique)
  *
  * For a small hash that just does key->value, you will often just extend a
@@ -403,19 +400,16 @@ void CLASSNAME::Remove(const KEY_TYPE aK
 //
 class NS_COM PLDHashStringEntry : public PLDHashEntryHdr
 {
 public:
   PLDHashStringEntry(const void* aKey) :
     mKey(*NS_STATIC_CAST(const nsAString*, aKey)) { }
   ~PLDHashStringEntry() { }
 
-  const void* GetKey() const {
-    return NS_STATIC_CAST(const nsAString*, &mKey);
-  }
   static PLDHashNumber HashKey(const void* key) {
     return HashString(*NS_STATIC_CAST(const nsAString*, key));
   }
   PRBool MatchEntry(const void* key) const {
     return NS_STATIC_CAST(const nsAString*, key)->Equals(mKey);
   }
 
   const nsString mKey;
@@ -426,19 +420,16 @@ public:
 //
 class NS_COM PLDHashCStringEntry : public PLDHashEntryHdr
 {
 public:
   PLDHashCStringEntry(const void* aKey) :
     mKey(*NS_STATIC_CAST(const nsACString*, aKey)) { }
   ~PLDHashCStringEntry() { }
 
-  const void* GetKey() const {
-    return NS_STATIC_CAST(const nsACString*, &mKey);
-  }
   static PLDHashNumber HashKey(const void* key) {
     return HashString(*NS_STATIC_CAST(const nsACString*, key));
   }
   PRBool MatchEntry(const void* key) const {
     return NS_STATIC_CAST(const nsACString*, key)->Equals(mKey);
   }
 
   const nsCString mKey;
@@ -449,19 +440,16 @@ public:
 //
 class NS_COM PLDHashInt32Entry : public PLDHashEntryHdr
 {
 public:
   PLDHashInt32Entry(const void* aKey) :
     mKey(*(NS_STATIC_CAST(const PRInt32*, aKey))) { }
   ~PLDHashInt32Entry() { }
 
-  const void* GetKey() const {
-    return NS_STATIC_CAST(const PRInt32*, &mKey);
-  }
   static PLDHashNumber HashKey(const void* key) {
     return *NS_STATIC_CAST(const PRInt32*, key);
   }
   PRBool MatchEntry(const void* key) const {
     return *(NS_STATIC_CAST(const PRInt32*, key)) == mKey;
   }
 
   const PRInt32 mKey;
@@ -473,19 +461,16 @@ public:
 //
 class NS_COM PLDHashVoidEntry : public PLDHashEntryHdr
 {
 public:
   PLDHashVoidEntry(const void* aKey) :
     mKey(*(const void**)aKey) { }
   ~PLDHashVoidEntry() { }
 
-  const void* GetKey() const {
-    return (const void**)&mKey;
-  }
   static PLDHashNumber HashKey(const void* key) {
     return PLDHashNumber(NS_PTR_TO_INT32(*(const void**)key)) >> 2;
   }
   PRBool MatchEntry(const void* key) const {
     return *(const void**)key == mKey;
   }
 
   const void* mKey;