From 9c3c5e4360b3b42a8fb88d43fb5df8831b0dbdb6 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Wed, 19 Feb 2014 00:49:15 -0500 Subject: [PATCH] Bug 969883 - Remove some unneeded memory allocation failure handling code in table cell map code; r=dbaron The data structures manipulated by this code use infallible memory allocation, so the OOM handling code paths here are dead code. --- layout/tables/nsCellMap.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/layout/tables/nsCellMap.cpp b/layout/tables/nsCellMap.cpp index f01b0fc81529..105da2c707d6 100644 --- a/layout/tables/nsCellMap.cpp +++ b/layout/tables/nsCellMap.cpp @@ -108,8 +108,7 @@ nsTableCellMap::GetRightMostBorder(int32_t aRowIndex) return &mBCInfo->mRightBorders.ElementAt(aRowIndex); } - if (!mBCInfo->mRightBorders.SetLength(aRowIndex+1)) - ABORT1(nullptr); + mBCInfo->mRightBorders.SetLength(aRowIndex+1); return &mBCInfo->mRightBorders.ElementAt(aRowIndex); } @@ -124,8 +123,7 @@ nsTableCellMap::GetBottomMostBorder(int32_t aColIndex) return &mBCInfo->mBottomBorders.ElementAt(aColIndex); } - if (!mBCInfo->mBottomBorders.SetLength(aColIndex+1)) - ABORT1(nullptr); + mBCInfo->mBottomBorders.SetLength(aColIndex+1); return &mBCInfo->mBottomBorders.ElementAt(aColIndex); } @@ -488,15 +486,13 @@ nsTableCellMap::InsertRows(nsTableRowGroupFrame* aParent, int32_t count = mBCInfo->mRightBorders.Length(); if (aFirstRowIndex < count) { for (int32_t rowX = aFirstRowIndex; rowX < aFirstRowIndex + numNewRows; rowX++) { - if (!mBCInfo->mRightBorders.InsertElementAt(rowX)) - ABORT0(); + mBCInfo->mRightBorders.InsertElementAt(rowX); } } else { GetRightMostBorder(aFirstRowIndex); // this will create missing entries for (int32_t rowX = aFirstRowIndex + 1; rowX < aFirstRowIndex + numNewRows; rowX++) { - if (!mBCInfo->mRightBorders.AppendElement()) - ABORT0(); + mBCInfo->mRightBorders.AppendElement(); } } }