Bug 1338086 - Remove useless else blocks in order to reduce complexity in toolkit/components/typeaheadfind r?mstange draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:57:07 +0100
changeset 484410 dcb1fd34816adaa606f6dcafc504c51498b5c769
parent 484409 12841f531dc3d313f241a5a150e63d0efeb5779c
child 484411 abd4456d4ea9027b64a5330fc23711679bd7a8a9
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 in toolkit/components/typeaheadfind r?mstange MozReview-Commit-ID: IdbRm6QFZb8
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -220,32 +220,32 @@ nsTypeAheadFind::ReleaseStrongMemberVari
   mSelectionController = nullptr;
 
   mFind = nullptr;
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::SetSelectionModeAndRepaint(int16_t aToggle)
 {
-  nsCOMPtr<nsISelectionController> selectionController = 
+  nsCOMPtr<nsISelectionController> selectionController =
     do_QueryReferent(mSelectionController);
   if (!selectionController) {
     return NS_OK;
   }
 
   selectionController->SetDisplaySelection(aToggle);
   selectionController->RepaintSelection(nsISelectionController::SELECTION_NORMAL);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::CollapseSelection()
 {
-  nsCOMPtr<nsISelectionController> selectionController = 
+  nsCOMPtr<nsISelectionController> selectionController =
     do_QueryReferent(mSelectionController);
   if (!selectionController) {
     return NS_OK;
   }
 
   nsCOMPtr<nsISelection> selection;
   selectionController->GetSelection(nsISelectionController::SELECTION_NORMAL,
                                      getter_AddRefs(selection));
@@ -256,30 +256,31 @@ nsTypeAheadFind::CollapseSelection()
 }
 
 NS_IMETHODIMP
 nsTypeAheadFind::Observe(nsISupports *aSubject, const char *aTopic,
                          const char16_t *aData)
 {
   if (!nsCRT::strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
     return PrefsReset();
-  } else if (!nsCRT::strcmp(aTopic, DOM_WINDOW_DESTROYED_TOPIC) &&
+  }
+  if (!nsCRT::strcmp(aTopic, DOM_WINDOW_DESTROYED_TOPIC) &&
              SameCOMIdentity(aSubject, mCurrentWindow)) {
     ReleaseStrongMemberVariables();
   }
 
   return NS_OK;
 }
 
 void
 nsTypeAheadFind::SaveFind()
 {
   if (mWebBrowserFind)
     mWebBrowserFind->SetSearchString(mTypeAheadBuffer.get());
-  
+
   // save the length of this find for "not found" sound
   mLastFindLength = mTypeAheadBuffer.Length();
 }
 
 void
 nsTypeAheadFind::PlayNotFoundSound()
 {
   if (mNotFoundSoundURL.IsEmpty())    // no sound