Bug 1664747 - Remove some duplicate if ("bugprone-redundant-branch-condition" warning) r=emilio,andi
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 14 Sep 2020 10:52:43 +0000
changeset 548508 651e68f628d0083c18b83056e5e495af67449e7d
parent 548507 5e6726b1293498358a8a287c261caf435a4d74d6
child 548509 89a92f877c43b994973b160227b980f579d10c4c
push id37782
push userccoroiu@mozilla.com
push dateMon, 14 Sep 2020 16:07:13 +0000
treeherdermozilla-central@b21d31971a86 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemilio, andi
bugs1664747
milestone82.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 1664747 - Remove some duplicate if ("bugprone-redundant-branch-condition" warning) r=emilio,andi Differential Revision: https://phabricator.services.mozilla.com/D90067
dom/smil/SMILTimedElement.cpp
layout/tables/nsTableFrame.cpp
layout/xul/nsBoxFrame.cpp
--- a/dom/smil/SMILTimedElement.cpp
+++ b/dom/smil/SMILTimedElement.cpp
@@ -1615,21 +1615,19 @@ bool SMILTimedElement::GetNextInterval(c
     // When we choose the interval endpoints, we don't allow coincident
     // zero-duration intervals, so if we arrive here and we have a zero-duration
     // interval starting at the same point as a previous zero-duration interval,
     // then it must be because we've applied constraints to the active duration.
     // In that case, we will potentially run into an infinite loop, so we break
     // it by searching for the next interval that starts AFTER our current
     // zero-duration interval.
     if (prevIntervalWasZeroDur && tempEnd->Time() == beginAfter) {
-      if (prevIntervalWasZeroDur) {
-        beginAfter.SetMillis(tempBegin->Time().GetMillis() + 1);
-        prevIntervalWasZeroDur = false;
-        continue;
-      }
+      beginAfter.SetMillis(tempBegin->Time().GetMillis() + 1);
+      prevIntervalWasZeroDur = false;
+      continue;
     }
     prevIntervalWasZeroDur = tempBegin->Time() == tempEnd->Time();
 
     // Check for valid interval
     if (tempEnd->Time() > zeroTime ||
         (tempBegin->Time() == zeroTime && tempEnd->Time() == zeroTime)) {
       aResult.Set(*tempBegin, *tempEnd);
       return true;
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -4316,24 +4316,24 @@ bool BCMapCellIterator::SetNewRowGroup(b
     if (rowCount > 0) {
       mCellMap = mTableCellMap->GetMapFor(mRowGroup, mCellMap);
       if (!mCellMap) ABORT1(false);
       nsTableRowFrame* firstRow = mRowGroup->GetFirstRow();
       if (aFindFirstDamagedRow) {
         if ((mAreaStart.y >= mRowGroupStart) &&
             (mAreaStart.y <= mRowGroupEnd)) {
           // the damage area starts in the row group
-          if (aFindFirstDamagedRow) {
-            // find the correct first damaged row
-            int32_t numRows = mAreaStart.y - mRowGroupStart;
-            for (int32_t i = 0; i < numRows; i++) {
-              firstRow = firstRow->GetNextRow();
-              if (!firstRow) ABORT1(false);
-            }
+
+          // find the correct first damaged row
+          int32_t numRows = mAreaStart.y - mRowGroupStart;
+          for (int32_t i = 0; i < numRows; i++) {
+            firstRow = firstRow->GetNextRow();
+            if (!firstRow) ABORT1(false);
           }
+
         } else {
           continue;
         }
       }
       if (SetNewRow(firstRow)) {  // sets mAtEnd
         break;
       }
     }
--- a/layout/xul/nsBoxFrame.cpp
+++ b/layout/xul/nsBoxFrame.cpp
@@ -954,23 +954,21 @@ void nsBoxFrame::BuildDisplayList(nsDisp
     masterList.AppendToTop(tempLists.BlockBorderBackgrounds());
     masterList.AppendToTop(tempLists.Floats());
     masterList.AppendToTop(tempLists.Content());
     masterList.AppendToTop(tempLists.PositionedDescendants());
     masterList.AppendToTop(tempLists.Outlines());
     const ActiveScrolledRoot* ownLayerASR = contASRTracker->GetContainerASR();
     DisplayListClipState::AutoSaveRestore ownLayerClipState(aBuilder);
 
-    if (forceLayer) {
-      // Wrap the list to make it its own layer
-      aLists.Content()->AppendNewToTopWithIndex<nsDisplayOwnLayer>(
-          aBuilder, this, /* aIndex = */ nsDisplayOwnLayer::OwnLayerForBoxFrame,
-          &masterList, ownLayerASR, nsDisplayOwnLayerFlags::None,
-          mozilla::layers::ScrollbarData{}, true, true);
-    }
+    // Wrap the list to make it its own layer
+    aLists.Content()->AppendNewToTopWithIndex<nsDisplayOwnLayer>(
+        aBuilder, this, /* aIndex = */ nsDisplayOwnLayer::OwnLayerForBoxFrame,
+        &masterList, ownLayerASR, nsDisplayOwnLayerFlags::None,
+        mozilla::layers::ScrollbarData{}, true, true);
   }
 }
 
 void nsBoxFrame::BuildDisplayListForChildren(nsDisplayListBuilder* aBuilder,
                                              const nsDisplayListSet& aLists) {
   nsIFrame* kid = mFrames.FirstChild();
   // Put each child's background onto the BlockBorderBackgrounds list
   // to emulate the existing two-layer XUL painting scheme.