Bug 1604099 - Remove redundant call to GetColCount from nsCellMap::ShrinkWithoutCell. r=emilio
authorAlex Henrie <alexhenrie24@gmail.com>
Mon, 16 Dec 2019 08:21:52 +0000
changeset 507052 d3918dafc6a8695e8003d7cf15ba8a4f1e974943
parent 507051 b0fb09545a0128c4ffdc4806e9f97cb3281f133c
child 507053 51f016ea456e5d3d284944e93db88022328069fb
push id36922
push userncsoregi@mozilla.com
push dateMon, 16 Dec 2019 17:21:47 +0000
treeherdermozilla-central@27d0d6cc2131 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio
bugs1604099
milestone73.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 1604099 - Remove redundant call to GetColCount from nsCellMap::ShrinkWithoutCell. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D57274
layout/tables/nsCellMap.cpp
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -1863,17 +1863,16 @@ void nsCellMap::ShrinkWithoutCell(nsTabl
                                   int32_t aRowIndex, int32_t aColIndex,
                                   int32_t aRgFirstRowIndex,
                                   TableArea& aDamageArea) {
   NS_ASSERTION(!!aMap.mBCInfo == mIsBC, "BC state mismatch");
   uint32_t colX, rowX;
 
   // get the rowspan and colspan from the cell map since the content may have
   // changed
-  uint32_t numCols = aMap.GetColCount();
   int32_t rowSpan = GetRowSpan(aRowIndex, aColIndex, true);
   uint32_t colSpan = GetEffectiveColSpan(aMap, aRowIndex, aColIndex);
   uint32_t endRowIndex = aRowIndex + rowSpan - 1;
   uint32_t endColIndex = aColIndex + colSpan - 1;
 
   // adjust the col counts due to the deleted cell before removing it
   for (colX = aColIndex; colX <= endColIndex; colX++) {
     nsColInfo* colInfo = aMap.GetColInfoAt(colX);
@@ -1897,17 +1896,17 @@ void nsCellMap::ShrinkWithoutCell(nsTabl
     if (uint32_t(aColIndex) < endIndexForRow) {
       for (colX = endIndexForRow; colX > uint32_t(aColIndex); colX--) {
         DestroyCellData(row[colX - 1]);
       }
       row.RemoveElementsAt(aColIndex, endIndexForRow - aColIndex);
     }
   }
 
-  numCols = aMap.GetColCount();
+  uint32_t numCols = aMap.GetColCount();
 
   // update the row and col info due to shifting
   for (rowX = aRowIndex; rowX <= endRowIndex; rowX++) {
     CellDataArray& row = mRows[rowX];
     for (colX = aColIndex; colX < numCols - colSpan; colX++) {
       CellData* data = row.SafeElementAt(colX);
       if (data) {
         if (data->IsOrig()) {