Bug 1338086 - Remove useless else blocks in order to reduce complexity widget/ r?mstange draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:58:25 +0100
changeset 484405 5d7ff65c7317c64e5ada34aa42624a4be23b4ba1
parent 484404 5f99bce7bf4e85f925684b1c6a9ab2a8e840c945
child 484406 161f8ff90366dc27d50a946c1b09d3fccec71cdc
push id45470
push userbmo:sledru@mozilla.com
push dateWed, 15 Feb 2017 08:57:47 +0000
reviewersmstange
bugs1338086
milestone54.0a1
Bug 1338086 - Remove useless else blocks in order to reduce complexity widget/ r?mstange MozReview-Commit-ID: AjL8H7aHLkm
widget/nsBaseWidget.cpp
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1210,30 +1210,31 @@ nsEventStatus
 nsBaseWidget::DispatchInputEvent(WidgetInputEvent* aEvent)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (mAPZC) {
     if (APZThreadUtils::IsControllerThread()) {
       uint64_t inputBlockId = 0;
       ScrollableLayerGuid guid;
 
-      nsEventStatus result = mAPZC->ReceiveInputEvent(*aEvent, &guid, &inputBlockId);
+      nsEventStatus result =
+        mAPZC->ReceiveInputEvent(*aEvent, &guid, &inputBlockId);
       if (result == nsEventStatus_eConsumeNoDefault) {
-          return result;
+        return result;
       }
       return ProcessUntransformedAPZEvent(aEvent, guid, inputBlockId, result);
-    } else {
-      WidgetWheelEvent* wheelEvent = aEvent->AsWheelEvent();
-      if (wheelEvent) {
-        RefPtr<Runnable> r = new DispatchWheelInputOnControllerThread(*wheelEvent, mAPZC, this);
-        APZThreadUtils::RunOnControllerThread(r.forget());
-        return nsEventStatus_eConsumeDoDefault;
-      }
-      MOZ_CRASH();
     }
+    WidgetWheelEvent* wheelEvent = aEvent->AsWheelEvent();
+    if (wheelEvent) {
+      RefPtr<Runnable> r =
+        new DispatchWheelInputOnControllerThread(*wheelEvent, mAPZC, this);
+      APZThreadUtils::RunOnControllerThread(r.forget());
+      return nsEventStatus_eConsumeDoDefault;
+    }
+    MOZ_CRASH();
   }
 
   nsEventStatus status;
   DispatchEvent(aEvent, status);
   return status;
 }
 
 void