Bug 975223, part 1 - Make braces less weird in nsRefPtrHashtable. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Mon, 24 Feb 2014 17:16:10 -0800
changeset 170653 775ed04f9f491de675657657f8fd928062ad3d0b
parent 170652 8a109eb551fcf517d6b1c0e04e2296c7920267e2
child 170654 6f39cfbcb4c6617993a07629fa4ce3c097cb6bf0
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersfroydnj
bugs975223
milestone30.0a1
Bug 975223, part 1 - Make braces less weird in nsRefPtrHashtable. r=froydnj
xpcom/glue/nsRefPtrHashtable.h
--- a/xpcom/glue/nsRefPtrHashtable.h
+++ b/xpcom/glue/nsRefPtrHashtable.h
@@ -77,50 +77,51 @@ ImplCycleCollectionTraverse(nsCycleColle
 
 template<class KeyClass, class RefPtr>
 bool
 nsRefPtrHashtable<KeyClass,RefPtr>::Get
   (KeyType aKey, UserDataType* pRefPtr) const
 {
   typename base_type::EntryType* ent = this->GetEntry(aKey);
 
-  if (ent)
-  {
-    if (pRefPtr)
-    {
+  if (ent) {
+    if (pRefPtr) {
       *pRefPtr = ent->mData;
 
       NS_IF_ADDREF(*pRefPtr);
     }
 
     return true;
   }
 
   // if the key doesn't exist, set *pRefPtr to null
   // so that it is a valid XPCOM getter
-  if (pRefPtr)
+  if (pRefPtr) {
     *pRefPtr = nullptr;
+  }
 
   return false;
 }
 
 template<class KeyClass, class RefPtr>
 RefPtr*
 nsRefPtrHashtable<KeyClass,RefPtr>::GetWeak
   (KeyType aKey, bool* aFound) const
 {
   typename base_type::EntryType* ent = this->GetEntry(aKey);
 
-  if (ent)
-  {
-    if (aFound)
+  if (ent) {
+    if (aFound) {
       *aFound = true;
+    }
 
     return ent->mData;
   }
 
   // Key does not exist, return nullptr and set aFound to false
-  if (aFound)
+  if (aFound) {
     *aFound = false;
+  }
+
   return nullptr;
 }
 
 #endif // nsRefPtrHashtable_h__