Bug 1210463 - part 1 - Remove some unneeded null checks on new in ModuleUtils. r=froydnj
authorAndrew McCreight <continuation@gmail.com>
Thu, 01 Oct 2015 15:53:38 -0700
changeset 265651 02581fcdff44d580dc43a9c3d2f6af3ce892f335
parent 265650 f49b6f48c99381753b01e0dc43a666774301af3d
child 265652 15fe8692377c2a77672cd95f52164a4bc3b2c37f
push id15472
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:51:34 +0000
treeherderfx-team@2c33ef6b27e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1210463
milestone44.0a1
Bug 1210463 - part 1 - Remove some unneeded null checks on new in ModuleUtils. r=froydnj
xpcom/components/ModuleUtils.h
--- a/xpcom/components/ModuleUtils.h
+++ b/xpcom/components/ModuleUtils.h
@@ -20,20 +20,16 @@ static nsresult                         
                                                                               \
     *aResult = nullptr;                                                       \
     if (nullptr != aOuter) {                                                  \
         rv = NS_ERROR_NO_AGGREGATION;                                         \
         return rv;                                                            \
     }                                                                         \
                                                                               \
     inst = new _InstanceClass();                                              \
-    if (nullptr == inst) {                                                    \
-        rv = NS_ERROR_OUT_OF_MEMORY;                                          \
-        return rv;                                                            \
-    }                                                                         \
     NS_ADDREF(inst);                                                          \
     rv = inst->QueryInterface(aIID, aResult);                                 \
     NS_RELEASE(inst);                                                         \
                                                                               \
     return rv;                                                                \
 }
 
 #define NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(_InstanceClass, _InitMethod)      \
@@ -47,20 +43,16 @@ static nsresult                         
                                                                               \
     *aResult = nullptr;                                                       \
     if (nullptr != aOuter) {                                                  \
         rv = NS_ERROR_NO_AGGREGATION;                                         \
         return rv;                                                            \
     }                                                                         \
                                                                               \
     inst = new _InstanceClass();                                              \
-    if (nullptr == inst) {                                                    \
-        rv = NS_ERROR_OUT_OF_MEMORY;                                          \
-        return rv;                                                            \
-    }                                                                         \
     NS_ADDREF(inst);                                                          \
     rv = inst->_InitMethod();                                                 \
     if(NS_SUCCEEDED(rv)) {                                                    \
         rv = inst->QueryInterface(aIID, aResult);                             \
     }                                                                         \
     NS_RELEASE(inst);                                                         \
                                                                               \
     return rv;                                                                \