Bug 1338086 - Remove useless else blocks in order to reduce complexity in view/ r=tnikkel
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:42:41 +0100
changeset 343034 0775748c6e495da30eda4ac187e248e71377de47
parent 343033 a1411b3c461e358624a8f0552264ac755e264f2c
child 343035 5bf8f4e866efa81d997c5ca15ecee4e1a29cfdfb
push id31368
push userkwierso@gmail.com
push dateWed, 15 Feb 2017 23:26:19 +0000
treeherdermozilla-central@e783bdf2cb50 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1338086
milestone54.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 1338086 - Remove useless else blocks in order to reduce complexity in view/ r=tnikkel MozReview-Commit-ID: 6H794QjWZ1t
view/nsView.cpp
view/nsViewManager.cpp
--- a/view/nsView.cpp
+++ b/view/nsView.cpp
@@ -1016,17 +1016,17 @@ nsView::WindowResized(nsIWidget* aWidget
       nsIPresShell* presShell = mViewManager->GetPresShell();
       if (presShell && presShell->GetDocument()) {
         pm->AdjustPopupsOnWindowChange(presShell);
       }
     }
 
     return true;
   }
-  else if (IsPopupWidget(aWidget)) {
+  if (IsPopupWidget(aWidget)) {
     nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
     if (pm) {
       pm->PopupResized(mFrame, LayoutDeviceIntSize(aWidth, aHeight));
       return true;
     }
   }
 
   return false;
--- a/view/nsViewManager.cpp
+++ b/view/nsViewManager.cpp
@@ -992,28 +992,28 @@ nsViewManager::SetViewVisibility(nsView 
     aView->SetVisibility(aVisible);
   }
 }
 
 bool nsViewManager::IsViewInserted(nsView *aView)
 {
   if (mRootView == aView) {
     return true;
-  } else if (aView->GetParent() == nullptr) {
-    return false;
-  } else {
-    nsView* view = aView->GetParent()->GetFirstChild();
-    while (view != nullptr) {
-      if (view == aView) {
-        return true;
-      }
-      view = view->GetNextSibling();
-    }
+  }
+  if (aView->GetParent() == nullptr) {
     return false;
   }
+  nsView* view = aView->GetParent()->GetFirstChild();
+  while (view != nullptr) {
+    if (view == aView) {
+      return true;
+    }
+    view = view->GetNextSibling();
+  }
+  return false;
 }
 
 void
 nsViewManager::SetViewZIndex(nsView *aView, bool aAutoZIndex, int32_t aZIndex)
 {
   NS_ASSERTION((aView != nullptr), "no view");
 
   // don't allow the root view's z-index to be changed. It should always be zero.