add early returns to nsMsgFilterAfterTheFact::ContinueExecutionPrompt, r=bienvenu
authortimeless <timeless@bemail.org>
Fri, 26 Aug 2011 15:35:39 -0700
changeset 9061 88fc3d12b3b768c1f8c4f6258cfc9626b431eb9a
parent 9060 e8423ae0f0ac0c3cdbacbd579280f2c969a68621
child 9062 72265fa31f49918ef1d2cf738b952e8eaf9ac2aa
push id230
push userbugzilla@standard8.plus.com
push dateTue, 08 Nov 2011 22:55:24 +0000
treeherdercomm-beta@63dad5648415 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbienvenu
add early returns to nsMsgFilterAfterTheFact::ContinueExecutionPrompt, r=bienvenu
mailnews/base/search/src/nsMsgFilterService.cpp
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -1061,44 +1061,43 @@ NS_IMETHODIMP nsMsgFilterAfterTheFact::O
     return OnEndExecution(aStatus);
   if (m_nextAction) // a non-zero m_nextAction means additional actions needed
     return ApplyFilter();
   return RunNextFilter();
 }
 
 PRBool nsMsgFilterAfterTheFact::ContinueExecutionPrompt()
 {
-  PRBool returnVal = PR_FALSE;
   if (!m_curFilter)
-    return returnVal;
-  nsresult rv;
-  nsCOMPtr <nsIStringBundle> bundle;
-  nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
-  if (bundleService && NS_SUCCEEDED(rv))
-    bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
-                                 getter_AddRefs(bundle));
-  if (NS_SUCCEEDED(rv) && bundle)
+    return PR_FALSE;
+  nsCOMPtr<nsIStringBundle> bundle;
+  nsCOMPtr<nsIStringBundleService> bundleService = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
+  if (!bundleService)
+    return PR_FALSE;
+  bundleService->CreateBundle("chrome://messenger/locale/filter.properties",
+                              getter_AddRefs(bundle));
+  if (!bundle)
+    return PR_FALSE;
+  nsString filterName;
+  m_curFilter->GetFilterName(filterName);
+  nsString formatString;
+  nsString confirmText;
+  const PRUnichar *formatStrings[] =
   {
-    nsString filterName;
-    m_curFilter->GetFilterName(filterName);
-    nsString formatString;
-    nsString confirmText;
-    const PRUnichar *formatStrings[] =
-    {
-      filterName.get()
-    };
-    rv = bundle->FormatStringFromName(NS_LITERAL_STRING("continueFilterExecution").get(),
-                                      formatStrings, 1, getter_Copies(confirmText));
-    if (NS_SUCCEEDED(rv))
-    {
-      rv = DisplayConfirmationPrompt(m_msgWindow, confirmText.get(), &returnVal);
-    }
-  }
+    filterName.get()
+  };
+  nsresult rv = bundle->FormatStringFromName(NS_LITERAL_STRING("continueFilterExecution").get(),
+                                             formatStrings, 1, getter_Copies(confirmText));
+  if (NS_FAILED(rv))
+    return PR_FALSE;
+  PRBool returnVal = PR_FALSE;
+  (void) DisplayConfirmationPrompt(m_msgWindow, confirmText.get(), &returnVal);
   return returnVal;
 }
+
 nsresult
 nsMsgFilterAfterTheFact::DisplayConfirmationPrompt(nsIMsgWindow *msgWindow, const PRUnichar *confirmString, PRBool *confirmed)
 {
   nsresult rv=NS_OK;
   if (msgWindow)
   {
     nsCOMPtr <nsIDocShell> docShell;
     msgWindow->GetRootDocShell(getter_AddRefs(docShell));