Bug 1531025 part 1: Add braces around conditions in nsIFrame::ComputeBorderRadii(). r=boris
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 04 Mar 2019 19:23:56 +0000
changeset 520171 818af1db79a228cc7709fd82eabe417e521259d1
parent 520170 71e5f2f8ca11283011a40cc7a30199417a0e48bf
child 520172 bfb349870bbfec611db4ca53391bdf61df15992b
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1531025
milestone67.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 1531025 part 1: Add braces around conditions in nsIFrame::ComputeBorderRadii(). r=boris This patch doesn't change any logic/behavior -- it's just adding braces for clarity. Differential Revision: https://phabricator.services.mozilla.com/D21578
layout/generic/nsFrame.cpp
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -1708,20 +1708,24 @@ bool nsIFrame::ComputeBorderRadii(const 
   bool haveRadius = false;
   double ratio = 1.0f;
   NS_FOR_CSS_SIDES(side) {
     uint32_t hc1 = SideToHalfCorner(side, false, true);
     uint32_t hc2 = SideToHalfCorner(side, true, true);
     nscoord length =
         SideIsVertical(side) ? aBorderArea.height : aBorderArea.width;
     nscoord sum = aRadii[hc1] + aRadii[hc2];
-    if (sum) haveRadius = true;
+    if (sum) {
+      haveRadius = true;
+    }
 
     // avoid floating point division in the normal case
-    if (length < sum) ratio = std::min(ratio, double(length) / sum);
+    if (length < sum) {
+      ratio = std::min(ratio, double(length) / sum);
+    }
   }
   if (ratio < 1.0) {
     NS_FOR_CSS_HALF_CORNERS(corner) { aRadii[corner] *= ratio; }
   }
 
   return haveRadius;
 }