Bug 1338086 - Remove useless else blocks in order to reduce complexity in widget/xremoteclient/ r?nical draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:58:40 +0100
changeset 484427 d267e420ed59b47c42a7e5eda174bb9911d77600
parent 484426 e9bb472aeff706389eb71d1fdce0d5c5f13e9a55
child 484428 97bf3cbd5d32ccec0bb6a7be9866045a27ba2cf1
push id45470
push userbmo:sledru@mozilla.com
push dateWed, 15 Feb 2017 08:57:47 +0000
reviewersnical
bugs1338086
milestone54.0a1
Bug 1338086 - Remove useless else blocks in order to reduce complexity in widget/xremoteclient/ r?nical MozReview-Commit-ID: ANIe9jnCdah
widget/xremoteclient/XRemoteClient.cpp
--- a/widget/xremoteclient/XRemoteClient.cpp
+++ b/widget/xremoteclient/XRemoteClient.cpp
@@ -146,19 +146,19 @@ XRemoteClient::Shutdown (void)
 
 static int
 HandleBadWindow(Display *display, XErrorEvent *event)
 {
   if (event->error_code == BadWindow) {
     sGotBadWindow = true;
     return 0; // ignored
   }
-  else {
+  
     return (*sOldHandler)(display, event);
-  }
+  
 }
 
 nsresult
 XRemoteClient::SendCommandLine (const char *aProgram, const char *aUsername,
                                 const char *aProfile,
                                 int32_t argc, char **argv,
                                 const char* aDesktopStartupID,
                                 char **aResponse, bool *aWindowFound)
@@ -379,17 +379,17 @@ XRemoteClient::GetLock(Window aWindow, b
 	MOZ_LOG(sRemoteLm, LogLevel::Debug, ("xevent...\n"));
 	XNextEvent (mDisplay, &event);
 	if (event.xany.type == DestroyNotify &&
 	    event.xdestroywindow.window == aWindow) {
 	  *aDestroyed = true;
           rv = NS_ERROR_FAILURE;
           break;
 	}
-	else if (event.xany.type == PropertyNotify &&
+	if (event.xany.type == PropertyNotify &&
 		 event.xproperty.state == PropertyDelete &&
 		 event.xproperty.window == aWindow &&
 		 event.xproperty.atom == mMozLockAtom) {
 	  /* Ok!  Someone deleted their lock, so now we can try
 	     again. */
 	  MOZ_LOG(sRemoteLm, LogLevel::Debug,
 		 ("(0x%x unlocked, trying again...)\n",
 		  (unsigned int) aWindow));
@@ -579,17 +579,17 @@ XRemoteClient::FreeLock(Window aWindow)
                               &nitems, &bytes_after,
                               &data);
   if (result != Success) {
       MOZ_LOG(sRemoteLm, LogLevel::Debug,
              ("unable to read and delete " MOZILLA_LOCK_PROP
               " property\n"));
       return NS_ERROR_FAILURE;
   }
-  else if (!data || !*data){
+  if (!data || !*data){
       MOZ_LOG(sRemoteLm, LogLevel::Debug,
              ("invalid data on " MOZILLA_LOCK_PROP
               " of window 0x%x.\n",
               (unsigned int) aWindow));
       return NS_ERROR_FAILURE;
   }
   else if (strcmp((char *)data, mLockData)) {
       MOZ_LOG(sRemoteLm, LogLevel::Debug,
@@ -704,17 +704,17 @@ XRemoteClient::WaitForResponse(Window aW
       /* Print to warn user...*/
       MOZ_LOG(sRemoteLm, LogLevel::Debug,
              ("window 0x%x was destroyed.\n",
               (unsigned int) aWindow));
       *aResponse = strdup("Window was destroyed while reading response.");
       *aDestroyed = true;
       return false;
     }
-    else if (event.xany.type == PropertyNotify &&
+    if (event.xany.type == PropertyNotify &&
              event.xproperty.state == PropertyNewValue &&
              event.xproperty.window == aWindow &&
              event.xproperty.atom == mMozResponseAtom) {
       Atom actual_type;
       int actual_format;
       unsigned long nitems, bytes_after;
       unsigned char *data = 0;
       Bool result;