Bug 975037, part 1 - Inline nsPersistentProperties::Init. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Thu, 27 Feb 2014 10:04:10 -0800
changeset 171341 d3e372d1c88a048f580cccd7a2ba90efa7baf8bb
parent 171340 c95f331f043df4c2c9396f685826cdd07d12810d
child 171342 a180f34d3eb79ed2ca5bdb6e91b14eb8809cce65
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersfroydnj
bugs975037
milestone30.0a1
Bug 975037, part 1 - Inline nsPersistentProperties::Init. r=froydnj
xpcom/ds/nsPersistentProperties.cpp
xpcom/ds/nsPersistentProperties.h
--- a/xpcom/ds/nsPersistentProperties.cpp
+++ b/xpcom/ds/nsPersistentProperties.cpp
@@ -441,45 +441,40 @@ nsresult nsPropertiesParser::ParseBuffer
 
   return NS_OK;
 }
 
 nsPersistentProperties::nsPersistentProperties()
 : mIn(nullptr)
 {
   mSubclass = static_cast<nsIPersistentProperties*>(this);
-  mTable.ops = nullptr;
+
+  PL_DHashTableInit(&mTable, &property_HashTableOps, nullptr,
+                    sizeof(PropertyTableEntry), 20);
+
   PL_INIT_ARENA_POOL(&mArena, "PersistentPropertyArena", 2048);
 }
 
 nsPersistentProperties::~nsPersistentProperties()
 {
   PL_FinishArenaPool(&mArena);
   if (mTable.ops)
     PL_DHashTableFinish(&mTable);
 }
 
-void
-nsPersistentProperties::Init()
-{
-  PL_DHashTableInit(&mTable, &property_HashTableOps, nullptr,
-                    sizeof(PropertyTableEntry), 20);
-}
-
 nsresult
 nsPersistentProperties::Create(nsISupports *aOuter, REFNSIID aIID, void **aResult)
 {
   if (aOuter)
     return NS_ERROR_NO_AGGREGATION;
   nsPersistentProperties* props = new nsPersistentProperties();
   if (props == nullptr)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ADDREF(props);
-  props->Init();
   nsresult rv = props->QueryInterface(aIID, aResult);
 
   NS_RELEASE(props);
   return rv;
 }
 
 NS_IMPL_ISUPPORTS2(nsPersistentProperties, nsIPersistentProperties, nsIProperties)
 
--- a/xpcom/ds/nsPersistentProperties.h
+++ b/xpcom/ds/nsPersistentProperties.h
@@ -14,17 +14,16 @@
 #include "mozilla/Attributes.h"
 
 class nsIUnicharInputStream;
 
 class nsPersistentProperties MOZ_FINAL : public nsIPersistentProperties
 {
 public:
   nsPersistentProperties();
-  void Init();
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIPROPERTIES
   NS_DECL_NSIPERSISTENTPROPERTIES
 
   static nsresult
   Create(nsISupports *aOuter, REFNSIID aIID, void **aResult);