Bug 1170416 (part 4) - Remove some unnecessary casts. r=froydnj.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 20 May 2015 21:16:59 -0700
changeset 264983 520b7441a2f6b40448cf464c771568d19a0f012e
parent 264982 d9dc9bdff1a04e7f8b8294bf25658bd3d16f6afc
child 264984 9d9f124a55a7c144977671de548744ae9c8327fa
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1170416
milestone41.0a1
Bug 1170416 (part 4) - Remove some unnecessary casts. r=froydnj.
xpcom/glue/nsBaseHashtable.h
xpcom/glue/nsTHashtable.h
--- a/xpcom/glue/nsBaseHashtable.h
+++ b/xpcom/glue/nsBaseHashtable.h
@@ -166,17 +166,17 @@ public:
    * @param aUserArg passed unchanged to the EnumReadFunction
    */
   uint32_t EnumerateRead(EnumReadFunction aEnumFunc, void* aUserArg) const
   {
     NS_ASSERTION(this->mTable.IsInitialized(),
                  "nsBaseHashtable was not initialized properly.");
 
     s_EnumReadArgs enumData = { aEnumFunc, aUserArg };
-    return PL_DHashTableEnumerate(const_cast<PLDHashTable*>(static_cast<const PLDHashTable*>(&this->mTable)),
+    return PL_DHashTableEnumerate(const_cast<PLDHashTable*>(&this->mTable),
                                   s_EnumReadStub,
                                   &enumData);
   }
 
   /**
    * function type provided by the application for enumeration.
    * @param aKey the key being enumerated
    * @param aData Reference to data being enumerated, may be altered. e.g. for
--- a/xpcom/glue/nsTHashtable.h
+++ b/xpcom/glue/nsTHashtable.h
@@ -129,17 +129,17 @@ public:
    *            key doesn't exist
    */
   EntryType* GetEntry(KeyType aKey) const
   {
     NS_ASSERTION(mTable.IsInitialized(),
                  "nsTHashtable was not initialized properly.");
 
     return static_cast<EntryType*>(
-      PL_DHashTableSearch(const_cast<PLDHashTable*>(static_cast<const PLDHashTable*>(&mTable)),
+      PL_DHashTableSearch(const_cast<PLDHashTable*>(&mTable),
                           EntryType::KeyToPointer(aKey)));
   }
 
   /**
    * Return true if an entry for the given key exists, false otherwise.
    * @param     aKey the key to retrieve
    * @return    true if the key exists, false if the key doesn't exist
    */