Bug 1338086 - Remove useless else blocks in order to reduce complexity in widget/xremoteclient/ r?nical
MozReview-Commit-ID: ANIe9jnCdah
--- 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;