Bug 809533, patch 5: Remove unneeded null-checks in nsIPresShell.h. r=roc
authorL. David Baron <dbaron@dbaron.org>
Fri, 09 Nov 2012 10:30:28 -0800
changeset 112862 d6c8276fe88ecf228d07eab1a84f60b2f267803b
parent 112861 0be0f375cac84429ef1fe63e422db4c47761c64d
child 112863 d6dd6d94c1a1af61896d34c02fc855fffc04f75c
push id17799
push userdbaron@mozilla.com
push dateFri, 09 Nov 2012 18:30:51 +0000
treeherdermozilla-inbound@d6c8276fe88e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs809533
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 809533, patch 5: Remove unneeded null-checks in nsIPresShell.h. r=roc
layout/base/nsIPresShell.h
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -195,20 +195,17 @@ public:
    * AllocateFrame is fallible, it returns nullptr on out-of-memory.
    */
   void* AllocateFrame(nsQueryFrame::FrameIID aID, size_t aSize)
   {
 #ifdef DEBUG
     mPresArenaAllocCount++;
 #endif
     void* result = mFrameArena.AllocateByFrameID(aID, aSize);
-  
-    if (result) {
-      memset(result, 0, aSize);
-    }
+    memset(result, 0, aSize);
     return result;
   }
 
   void FreeFrame(nsQueryFrame::FrameIID aID, void* aPtr)
   {
 #ifdef DEBUG
     mPresArenaAllocCount--;
 #endif
@@ -223,20 +220,17 @@ public:
    * AllocateByObjectID is fallible, it returns nullptr on out-of-memory.
    */
   void* AllocateByObjectID(nsPresArena::ObjectID aID, size_t aSize)
   {
 #ifdef DEBUG
     mPresArenaAllocCount++;
 #endif
     void* result = mFrameArena.AllocateByObjectID(aID, aSize);
-  
-    if (result) {
-      memset(result, 0, aSize);
-    }
+    memset(result, 0, aSize);
     return result;
   }
 
   void FreeByObjectID(nsPresArena::ObjectID aID, void* aPtr)
   {
 #ifdef DEBUG
     mPresArenaAllocCount--;
 #endif