Bug 1337449, Simplify the code by removing "} else {" after a break/return/continue, r=kaie
authorSylvestre Ledru <sledru@mozilla.com>
Wed, 07 Jun 2017 15:23:43 +0200
changeset 4732 85977b5eba80d116d8314a1be0cc8a4db6fae4f1
parent 4731 6f047f28d1209baf91b3171cfc4311f9688c1f9c
child 4734 24f9bb30f9f2f46b317e63c592824180ff458a62
push id250
push userkaie@kuix.de
push dateWed, 07 Jun 2017 13:23:38 +0000
reviewerskaie
bugs1337449
Bug 1337449, Simplify the code by removing "} else {" after a break/return/continue, r=kaie
pr/src/io/prlayer.c
pr/src/io/prmmap.c
pr/src/io/prscanf.c
pr/src/md/unix/unix.c
pr/src/md/unix/uxproces.c
pr/src/md/unix/uxshm.c
pr/src/misc/prnetdb.c
pr/src/misc/prtime.c
pr/src/misc/prtpool.c
pr/src/pthreads/ptio.c
--- a/pr/src/io/prlayer.c
+++ b/pr/src/io/prlayer.c
@@ -42,17 +42,18 @@ static PRStatus PR_CALLBACK pl_TopClose 
 	if (PR_IO_LAYER_HEAD == fd->identity) {
 		/*
 		 * new style stack; close all the layers, before deleting the
 		 * stack head
 		 */
 		rv = fd->lower->methods->close(fd->lower);
 		_PR_DestroyIOLayer(fd);
 		return rv;
-	} else if ((fd->higher) && (PR_IO_LAYER_HEAD == fd->higher->identity)) {
+	}
+	if ((fd->higher) && (PR_IO_LAYER_HEAD == fd->higher->identity)) {
 		/*
 		 * lower layers of new style stack
 		 */
 		lower = fd->lower;
 		/*
 		 * pop and cleanup current layer
 		 */
     	top = PR_PopIOLayer(fd->higher, PR_TOP_IO_LAYER);
@@ -196,26 +197,26 @@ static PRFileDesc* PR_CALLBACK pl_TopAcc
 
     newfd = (fd->lower->methods->accept)(fd->lower, addr, timeout);
     if (NULL == newfd)
     {
         PR_DELETE(newstack);
         return NULL;
     }
 
-    if (newstyle_stack) {
-		newstack->lower = newfd;
-		newfd->higher = newstack;
-		return newstack;
-	} else {
-		/* this PR_PushIOLayer call cannot fail */
-		rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack);
-		PR_ASSERT(PR_SUCCESS == rv);
-    	return newfd;  /* that's it */
-	}
+    if (newstyle_stack)
+    {
+        newstack->lower = newfd;
+        newfd->higher = newstack;
+        return newstack;
+    }
+    /* this PR_PushIOLayer call cannot fail */
+    rv = PR_PushIOLayer(newfd, PR_TOP_IO_LAYER, newstack);
+    PR_ASSERT(PR_SUCCESS == rv);
+    return newfd;  /* that's it */
 }
 
 static PRStatus PR_CALLBACK pl_DefBind (PRFileDesc *fd, const PRNetAddr *addr)
 {
     PR_ASSERT(fd != NULL);
     PR_ASSERT(fd->lower != NULL);
 
     return (fd->lower->methods->bind)(fd->lower, addr);
@@ -321,22 +322,21 @@ static PRInt32 PR_CALLBACK pl_DefAcceptr
         PR_DELETE(newstack);
         return nbytes;
     }
     if (newstyle_stack) {
 		newstack->lower = *nd;
 		(*nd)->higher = newstack;
 		*nd = newstack;
 		return nbytes;
-	} else {
-		/* this PR_PushIOLayer call cannot fail */
-		rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack);
-		PR_ASSERT(PR_SUCCESS == rv);
-		return nbytes;
 	}
+    /* this PR_PushIOLayer call cannot fail */
+    rv = PR_PushIOLayer(*nd, PR_TOP_IO_LAYER, newstack);
+    PR_ASSERT(PR_SUCCESS == rv);
+    return nbytes;
 }
 
 static PRInt32 PR_CALLBACK pl_DefTransmitfile (
     PRFileDesc *sd, PRFileDesc *fd, const void *headers, PRInt32 hlen,
     PRTransmitFileFlags flags, PRIntervalTime t)
 {
     PR_ASSERT(sd != NULL);
     PR_ASSERT(sd->lower != NULL);
@@ -489,20 +489,19 @@ PR_IMPLEMENT(PRFileDesc*) PR_CreateIOLay
  * _PR_DestroyIOLayer
  *		Delete the stack head of a new style stack.
  */
 
 static PRStatus _PR_DestroyIOLayer(PRFileDesc *stack)
 {
     if (NULL == stack)
         return PR_FAILURE;
-    else {
-        PR_DELETE(stack);
-    	return PR_SUCCESS;
-    }
+
+    PR_DELETE(stack);
+    return PR_SUCCESS;
 }  /* _PR_DestroyIOLayer */
 
 PR_IMPLEMENT(PRStatus) PR_PushIOLayer(
     PRFileDesc *stack, PRDescIdentity id, PRFileDesc *fd)
 {
     PRFileDesc *insert = PR_GetIdentitiesLayer(stack, id);
 
     PR_ASSERT(fd != NULL);
@@ -699,29 +698,29 @@ PR_IMPLEMENT(const char*) PR_GetNameForI
 }  /* PR_GetNameForIdentity */
 
 PR_IMPLEMENT(PRDescIdentity) PR_GetLayersIdentity(PRFileDesc* fd)
 {
     PR_ASSERT(NULL != fd);
     if (PR_IO_LAYER_HEAD == fd->identity) {
     	PR_ASSERT(NULL != fd->lower);
     	return fd->lower->identity;
-	} else
-    	return fd->identity;
+	}
+    return fd->identity;
 }  /* PR_GetLayersIdentity */
 
 PR_IMPLEMENT(PRFileDesc*) PR_GetIdentitiesLayer(PRFileDesc* fd, PRDescIdentity id)
 {
     PRFileDesc *layer = fd;
 
     if (PR_TOP_IO_LAYER == id) {
-    	if (PR_IO_LAYER_HEAD == fd->identity)
-			return fd->lower;
-		else 
-			return fd;
+      if (PR_IO_LAYER_HEAD == fd->identity) {
+          return fd->lower;
+      }
+      return fd;
 	}
 
     for (layer = fd; layer != NULL; layer = layer->lower)
     {
         if (id == layer->identity) return layer;
     }
     for (layer = fd; layer != NULL; layer = layer->higher)
     {
--- a/pr/src/io/prmmap.c
+++ b/pr/src/io/prmmap.c
@@ -19,27 +19,26 @@ PR_IMPLEMENT(PRFileMap *) PR_CreateFileM
     PRFileMapProtect prot)
 {
     PRFileMap *fmap;
 
     PR_ASSERT(prot == PR_PROT_READONLY || prot == PR_PROT_READWRITE
             || prot == PR_PROT_WRITECOPY);
     fmap = PR_NEWZAP(PRFileMap);
     if (NULL == fmap) {
-	PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
-	return NULL;
+      PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0);
+      return NULL;
     }
     fmap->fd = fd;
     fmap->prot = prot;
     if (_PR_MD_CREATE_FILE_MAP(fmap, size) == PR_SUCCESS) {
-	return fmap;
-    } else {
+      return fmap;
+    }
 	PR_DELETE(fmap);
 	return NULL;
-    }
 }
 
 PR_IMPLEMENT(PRInt32) PR_GetMemMapAlignment(void)
 {
     return _PR_MD_GET_MEM_MAP_ALIGNMENT();
 }
 
 PR_IMPLEMENT(void *) PR_MemMap(
--- a/pr/src/io/prscanf.c
+++ b/pr/src/io/prscanf.c
@@ -404,17 +404,18 @@ Convert(ScanfState *state, const char *f
             }
             if (state->width == 0) {
                 state->width = 1;
             }
             for (; state->width > 0; state->width--) {
                 ch = GET(state);
                 if (ch == EOF) {
                     return NULL;
-                } else if (state->assign) {
+                }
+                if (state->assign) {
                     *cArg++ = ch;
                 }
             }
             if (state->assign) {
                 state->converted = PR_TRUE;
             }
             break;
         case 'p':
@@ -597,20 +598,19 @@ DoScanf(ScanfState *state, const char *f
 
 static int
 StringGetChar(void *stream)
 {
     char *cPtr = *((char **) stream);
 
     if (*cPtr == '\0') {
         return EOF;
-    } else {
-        *((char **) stream) = cPtr + 1;
-        return (unsigned char) *cPtr;
     }
+    *((char **) stream) = cPtr + 1;
+    return (unsigned char) *cPtr;
 }
 
 static void
 StringUngetChar(void *stream, int ch)
 {
     char *cPtr = *((char **) stream);
 
     if (ch != EOF) {
--- a/pr/src/md/unix/unix.c
+++ b/pr/src/md/unix/unix.c
@@ -3311,42 +3311,42 @@ int _MD_unix_get_nonblocking_connect_err
             int err;
             _PRSockLen_t optlen = sizeof(err);
 
             if (getsockopt(osfd, SOL_SOCKET, SO_ERROR,
                     (char *) &err, &optlen) == -1) {
                 return errno;
             } else {
                 return err;
-            }		
+            }
         }
     } else {
         return ECONNREFUSED;
-    }	
+    }
 #elif defined(UNIXWARE)
     /*
      * getsockopt() fails with EPIPE, so use getmsg() instead.
      */
 
     int rv;
     int flags = 0;
     rv = getmsg(osfd, NULL, NULL, &flags);
     PR_ASSERT(-1 == rv || 0 == rv);
     if (-1 == rv && errno != EAGAIN && errno != EWOULDBLOCK) {
-        return errno;
+      return errno;
     }
-    return 0;  /* no error */
+    return 0; /* no error */
 #else
-    int err;
-    _PRSockLen_t optlen = sizeof(err);
-    if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char *) &err, &optlen) == -1) {
-        return errno;
-    } else {
-        return err;
-    }
+  int err;
+  _PRSockLen_t optlen = sizeof(err);
+  if (getsockopt(osfd, SOL_SOCKET, SO_ERROR, (char*)&err, &optlen) == -1) {
+    return errno;
+  }
+  return err;
+
 #endif
 }
 
 /************************************************************************/
 
 /*
 ** Special hacks for xlib. Xlib/Xt/Xm is not re-entrant nor is it thread
 ** safe.  Unfortunately, neither is mozilla. To make these programs work
--- a/pr/src/md/unix/uxproces.c
+++ b/pr/src/md/unix/uxproces.c
@@ -242,23 +242,24 @@ ForkAndExec(
 #endif
     if ((pid_t) -1 == process->md.pid) {
         PR_SetError(PR_INSUFFICIENT_RESOURCES_ERROR, errno);
         PR_DELETE(process);
         if (newEnvp) {
             PR_DELETE(newEnvp);
         }
         return NULL;
-    } else if (0 == process->md.pid) {  /* the child process */
-        /*
-         * If the child process needs to exit, it must call _exit().
-         * Do not call exit(), because exit() will flush and close
-         * the standard I/O file descriptors, and hence corrupt
-         * the parent process's standard I/O data structures.
-         */
+    }
+    if (0 == process->md.pid) {  /* the child process */
+      /*
+       * If the child process needs to exit, it must call _exit().
+       * Do not call exit(), because exit() will flush and close
+       * the standard I/O file descriptors, and hence corrupt
+       * the parent process's standard I/O data structures.
+       */
 
 #if !defined(NTO) && !defined(SYMBIAN)
         if (attr) {
             /* the osfd's to redirect stdin, stdout, and stderr to */
             int in_osfd = -1, out_osfd = -1, err_osfd = -1;
 
             if (attr->stdinFd
                     && attr->stdinFd->secret->md.osfd != 0) {
@@ -493,20 +494,19 @@ ExtractExitStatus(int rawExitStatus)
      * for waitpid, so these two events should not be reported.
      */
     PR_ASSERT(!WIFSTOPPED(rawExitStatus));
 #ifdef WIFCONTINUED
     PR_ASSERT(!WIFCONTINUED(rawExitStatus));
 #endif
     if (WIFEXITED(rawExitStatus)) {
 	return WEXITSTATUS(rawExitStatus);
-    } else {
+    }
 	PR_ASSERT(WIFSIGNALED(rawExitStatus));
 	return _PR_SIGNALED_EXITSTATUS;
-    }
 }
 
 static void
 ProcessReapedChildInternal(pid_t pid, int status)
 {
     pr_PidRecord *pRec;
 
     pRec = FindPidTable(pid);
--- a/pr/src/md/unix/uxshm.c
+++ b/pr/src/md/unix/uxshm.c
@@ -71,18 +71,18 @@ extern PRSharedMemory * _MD_OpenSharedMe
         PR_SetError(PR_OUT_OF_MEMORY_ERROR, 0 );
         PR_LOG(_pr_shm_lm, PR_LOG_DEBUG, ( "PR_OpenSharedMemory: New shm->ipcname out of memory")); 
         PR_DELETE( shm );
         return( NULL );
     }
 
     /* copy args to struct */
     strcpy( shm->ipcname, ipcname );
-    shm->size = size; 
-    shm->mode = mode; 
+    shm->size = size;
+    shm->mode = mode;
     shm->flags = flags;
     shm->ident = _PR_SHM_IDENT;
 
     /* create the file first */
     if ( flags & PR_SHM_CREATE )  {
         int osfd = open( shm->ipcname, (O_RDWR | O_CREAT), shm->mode );
         if ( -1 == osfd ) {
             _PR_MD_MAP_OPEN_ERROR( errno );
@@ -495,40 +495,42 @@ extern PRFileMap* _md_OpenAnonFileMap(
 #endif
         genName = PR_smprintf( NSPR_AFM_FILENAME,
             dirName, (int) pid, tid, incr );
         if ( NULL == genName ) {
             PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
                 ("_md_OpenAnonFileMap(): PR_snprintf(): failed, generating filename"));
             goto Finished;
         }
-        
+
         /* create the file */
-        osfd = open( genName, (O_CREAT | O_EXCL | O_RDWR), mode );
-        if ( -1 == osfd ) {
-            if ( EEXIST == errno )  {
-                PR_smprintf_free( genName );
-                continue; /* name exists, try again */
-            } else {
-                _PR_MD_MAP_OPEN_ERROR( errno );
-                PR_LOG( _pr_shma_lm, PR_LOG_DEBUG,
-                    ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d", 
-                        genName, PR_GetOSError()));
-                PR_smprintf_free( genName );
-                goto Finished;
-            }
+        osfd = open(genName, (O_CREAT | O_EXCL | O_RDWR), mode);
+        if (-1 == osfd) {
+          if (EEXIST == errno) {
+            PR_smprintf_free(genName);
+            continue; /* name exists, try again */
+          }
+          _PR_MD_MAP_OPEN_ERROR(errno);
+          PR_LOG(
+            _pr_shma_lm,
+            PR_LOG_DEBUG,
+            ("_md_OpenAnonFileMap(): open(): failed, filename: %s, errno: %d",
+             genName,
+             PR_GetOSError()));
+          PR_smprintf_free(genName);
+          goto Finished;
         }
         break; /* name generation and open successful, break; */
     } /* end for() */
 
-    if ( incr == maxTries ) {
-        PR_ASSERT( -1 == osfd );
-        PR_ASSERT( EEXIST == errno );
-        _PR_MD_MAP_OPEN_ERROR( errno );
-        goto Finished;
+    if (incr == maxTries) {
+      PR_ASSERT(-1 == osfd);
+      PR_ASSERT(EEXIST == errno);
+      _PR_MD_MAP_OPEN_ERROR(errno);
+      goto Finished;
     }
 
     urc = unlink( genName );
 #if defined(SYMBIAN) && defined(__WINS__)
     /* If it is being used by the system or another process, Symbian OS 
      * Emulator(WINS) considers this an error. */
     if ( -1 == urc && EACCES != errno ) {
 #else
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -1478,39 +1478,42 @@ PR_IMPLEMENT(PRStatus) PR_SetNetAddr(
 
 PR_IMPLEMENT(PRBool)
 PR_IsNetAddrType(const PRNetAddr *addr, PRNetAddrValue val)
 {
     if (addr->raw.family == PR_AF_INET6) {
         if (val == PR_IpAddrAny) {
 			if (_PR_IN6_IS_ADDR_UNSPECIFIED((PRIPv6Addr *)&addr->ipv6.ip)) {
             	return PR_TRUE;
-			} else if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
-					&& _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
-							== htonl(INADDR_ANY)) {
-            	return PR_TRUE;
+			}
+            if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
+                && _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
+                == htonl(INADDR_ANY)) {
+                return PR_TRUE;
 			}
         } else if (val == PR_IpAddrLoopback) {
             if (_PR_IN6_IS_ADDR_LOOPBACK((PRIPv6Addr *)&addr->ipv6.ip)) {
             	return PR_TRUE;
-			} else if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
-					&& _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
-							== htonl(INADDR_LOOPBACK)) {
-            	return PR_TRUE;
+			}
+            if (_PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)
+                && _PR_IN6_V4MAPPED_TO_IPADDR((PRIPv6Addr *)&addr->ipv6.ip)
+                == htonl(INADDR_LOOPBACK)) {
+                return PR_TRUE;
 			}
         } else if (val == PR_IpAddrV4Mapped
                 && _PR_IN6_IS_ADDR_V4MAPPED((PRIPv6Addr *)&addr->ipv6.ip)) {
             return PR_TRUE;
         }
     } else {
         if (addr->raw.family == AF_INET) {
             if (val == PR_IpAddrAny && addr->inet.ip == htonl(INADDR_ANY)) {
                 return PR_TRUE;
-            } else if (val == PR_IpAddrLoopback
-                    && addr->inet.ip == htonl(INADDR_LOOPBACK)) {
+            }
+            if (val == PR_IpAddrLoopback
+                && addr->inet.ip == htonl(INADDR_LOOPBACK)) {
                 return PR_TRUE;
             }
         }
     }
     return PR_FALSE;
 }
 
 extern int pr_inet_aton(const char *cp, PRUint32 *addr);
--- a/pr/src/misc/prtime.c
+++ b/pr/src/misc/prtime.c
@@ -274,18 +274,17 @@ PR_ImplodeTime(const PRExplodedTime *exp
  *
  *-------------------------------------------------------------------------
  */
 
 static int IsLeapYear(PRInt16 year)
 {
     if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
         return 1;
-    else
-        return 0;
+    return 0;
 }
 
 /*
  * 'secOffset' should be less than 86400 (i.e., a day).
  * 'time' should point to a normalized PRExplodedTime.
  */
 
 static void
@@ -1231,37 +1230,37 @@ PR_ParseTimeStringToExplodedTime(
                           {
                                 if (hour >= 0 && min >= 0) /* already got it */
                                   break;
 
                                 /* We have seen "[0-9]+:", so this is probably HH:MM[:SS] */
                                 if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
-                                else if ((end - rest) == 2)
+                                if ((end - rest) == 2)
                                   tmp_hour = ((rest[0]-'0')*10 +
                                                           (rest[1]-'0'));
                                 else
                                   tmp_hour = (rest[0]-'0');
 
                                 /* move over the colon, and parse minutes */
 
                                 rest = ++end;
                                 while (*end >= '0' && *end <= '9')
                                   end++;
 
                                 if (end == rest)
                                   /* no digits after first colon? */
                                   break;
-                                else if ((end - rest) > 2)
+                                if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
-                                else if ((end - rest) == 2)
+                                if ((end - rest) == 2)
                                   tmp_min = ((rest[0]-'0')*10 +
-                                                         (rest[1]-'0'));
+                                             (rest[1]-'0'));
                                 else
                                   tmp_min = (rest[0]-'0');
 
                                 /* now go for seconds */
                                 rest = end;
                                 if (*rest == ':')
                                   rest++;
                                 end = rest;
@@ -1269,17 +1268,17 @@ PR_ParseTimeStringToExplodedTime(
                                   end++;
 
                                 if (end == rest)
                                   /* no digits after second colon - that's ok. */
                                   ;
                                 else if ((end - rest) > 2)
                                   /* it is [0-9][0-9][0-9]+: */
                                   break;
-                                else if ((end - rest) == 2)
+                                if ((end - rest) == 2)
                                   tmp_sec = ((rest[0]-'0')*10 +
                                                          (rest[1]-'0'));
                                 else
                                   tmp_sec = (rest[0]-'0');
 
                                 /* If we made it here, we've parsed hour and min,
                                    and possibly sec, so it worked as a unit. */
 
@@ -1303,17 +1302,17 @@ PR_ParseTimeStringToExplodedTime(
                                   }
 
                                 hour = tmp_hour;
                                 min = tmp_min;
                                 sec = tmp_sec;
                                 rest = end;
                                 break;
                           }
-                        else if ((*end == '/' || *end == '-') &&
+                        if ((*end == '/' || *end == '-') &&
                                          end[1] >= '0' && end[1] <= '9')
                           {
                                 /* Perhaps this is 6/16/95, 16/6/95, 6-16-95, or 16-6-95
                                    or even 95-06-05...
                                    #### But it doesn't handle 1995-06-22.
                                  */
                                 int n1, n2, n3;
                                 const char *s;
@@ -2009,29 +2008,27 @@ pr_WeekOfYear(const PRExplodedTime* time
    int dayOfYear;
 
   /* Get the day of the year for the given time then adjust it to represent the
    * first day of the week containing the given time.
    */
   dayOfWeek = time->tm_wday - firstDayOfWeek;
   if (dayOfWeek < 0)
     dayOfWeek += 7;
-  
+
   dayOfYear = time->tm_yday - dayOfWeek;
 
-
   if( dayOfYear <= 0 )
   {
      /* If dayOfYear is <= 0, it is in the first partial week of the year. */
      return 0;
   }
-  else
-  {
-     /* Count the number of full weeks ( dayOfYear / 7 ) then add a week if there
-      * are any days left over ( dayOfYear % 7 ).  Because we are only counting to
-      * the first day of the week containing the given time, rather than to the
-      * actual day representing the given time, any days in week 0 will be "absorbed"
-      * as extra days in the given week.
-      */
-     return (dayOfYear / 7) + ( (dayOfYear % 7) == 0 ? 0 : 1 );
-  }
+
+  /* Count the number of full weeks ( dayOfYear / 7 ) then add a week if there
+   * are any days left over ( dayOfYear % 7 ).  Because we are only counting to
+   * the first day of the week containing the given time, rather than to the
+   * actual day representing the given time, any days in week 0 will be "absorbed"
+   * as extra days in the given week.
+   */
+  return (dayOfYear / 7) + ( (dayOfYear % 7) == 0 ? 0 : 1 );
+
 }
 
--- a/pr/src/misc/prtpool.c
+++ b/pr/src/misc/prtpool.c
@@ -857,26 +857,26 @@ PR_QueueJob_Connect(PRThreadPool *tpool,
 {
 	PRStatus rv;
 	PRErrorCode err;
 
 	rv = PR_Connect(iod->socket, addr, PR_INTERVAL_NO_WAIT);
 	if ((rv == PR_FAILURE) && ((err = PR_GetError()) == PR_IN_PROGRESS_ERROR)){
 		/* connection pending */
 		return(queue_io_job(tpool, iod, fn, arg, joinable, JOB_IO_CONNECT));
-	} else {
-		/*
-		 * connection succeeded or failed; add to jobq right away
-		 */
-		if (rv == PR_FAILURE)
-			iod->error = err;
-		else
-			iod->error = 0;
-		return(PR_QueueJob(tpool, fn, arg, joinable));
 	}
+    /*
+     * connection succeeded or failed; add to jobq right away
+     */
+    if (rv == PR_FAILURE)
+      iod->error = err;
+    else
+      iod->error = 0;
+    return(PR_QueueJob(tpool, fn, arg, joinable));
+
 }
 
 /* queue a job, when a timer expires */
 PR_IMPLEMENT(PRJob *)
 PR_QueueJob_Timer(PRThreadPool *tpool, PRIntervalTime timeout,
 							PRJobFn fn, void * arg, PRBool joinable)
 {
 	PRIntervalTime now;
--- a/pr/src/pthreads/ptio.c
+++ b/pr/src/pthreads/ptio.c
@@ -819,17 +819,17 @@ retry:
     {
         char *bp = (char*)op->arg2.buffer;
         bp += bytes;  /* adjust the buffer pointer */
         op->arg2.buffer = bp;
         op->result.code += bytes;  /* accumulate the number sent */
         op->arg3.amount -= bytes;  /* and reduce the required count */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_send_cont */
 
 static PRBool pt_write_cont(pt_Continuation *op, PRInt16 revents)
@@ -848,17 +848,17 @@ static PRBool pt_write_cont(pt_Continuat
     {
         char *bp = (char*)op->arg2.buffer;
         bp += bytes;  /* adjust the buffer pointer */
         op->arg2.buffer = bp;
         op->result.code += bytes;  /* accumulate the number sent */
         op->arg3.amount -= bytes;  /* and reduce the required count */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_write_cont */
 
 static PRBool pt_writev_cont(pt_Continuation *op, PRInt16 revents)
@@ -890,17 +890,17 @@ static PRBool pt_writev_cont(pt_Continua
                 break;  /* go off and do that */
             }
             bytes -= iov[iov_index].iov_len;  /* that element's consumed */
         }
         op->arg2.buffer = &iov[iov_index];  /* new start of array */
         op->arg3.amount -= iov_index;  /* and array length */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_writev_cont */
 
 static PRBool pt_sendto_cont(pt_Continuation *op, PRInt16 revents)
@@ -913,17 +913,17 @@ static PRBool pt_sendto_cont(pt_Continua
     {
         char *bp = (char*)op->arg2.buffer;
         bp += bytes;  /* adjust the buffer pointer */
         op->arg2.buffer = bp;
         op->result.code += bytes;  /* accumulate the number sent */
         op->arg3.amount -= bytes;  /* and reduce the required count */
         return (0 == op->arg3.amount) ? PR_TRUE : PR_FALSE;
     }
-    else if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
+    if ((EWOULDBLOCK != op->syserrno) && (EAGAIN != op->syserrno))
     {
         op->result.code = -1;
         return PR_TRUE;
     }
     else return PR_FALSE;
 }  /* pt_sendto_cont */
 
 static PRBool pt_recvfrom_cont(pt_Continuation *op, PRInt16 revents)
@@ -2869,63 +2869,61 @@ static PRStatus pt_GetSockName(PRFileDes
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = getsockname(
         fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
     if (rv == -1) {
         pt_MapError(_PR_MD_MAP_GETSOCKNAME_ERROR, errno);
         return PR_FAILURE;
-    } else {
+    }
 #ifdef _PR_HAVE_SOCKADDR_LEN
-        /* ignore the sa_len field of struct sockaddr */
-        if (addr)
-        {
-            addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-        }
+    /* ignore the sa_len field of struct sockaddr */
+    if (addr)
+    {
+        addr->raw.family = ((struct sockaddr*)addr)->sa_family;
+    }
 #endif /* _PR_HAVE_SOCKADDR_LEN */
 #ifdef _PR_INET6
-		if (AF_INET6 == addr->raw.family)
-			addr->raw.family = PR_AF_INET6;
+    if (AF_INET6 == addr->raw.family)
+        addr->raw.family = PR_AF_INET6;
 #endif
-        PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
-        PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-        return PR_SUCCESS;
-    }
+    PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
+    PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
+    return PR_SUCCESS;
 }  /* pt_GetSockName */
 
 static PRStatus pt_GetPeerName(PRFileDesc *fd, PRNetAddr *addr)
 {
     PRIntn rv = -1;
     pt_SockLen addr_len = sizeof(PRNetAddr);
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = getpeername(
         fd->secret->md.osfd, (struct sockaddr*)addr, &addr_len);
 
     if (rv == -1) {
         pt_MapError(_PR_MD_MAP_GETPEERNAME_ERROR, errno);
         return PR_FAILURE;
-    } else {
+    }
 #ifdef _PR_HAVE_SOCKADDR_LEN
-        /* ignore the sa_len field of struct sockaddr */
-        if (addr)
-        {
-            addr->raw.family = ((struct sockaddr*)addr)->sa_family;
-        }
+    /* ignore the sa_len field of struct sockaddr */
+    if (addr)
+    {
+        addr->raw.family = ((struct sockaddr*)addr)->sa_family;
+    }
 #endif /* _PR_HAVE_SOCKADDR_LEN */
 #ifdef _PR_INET6
-		if (AF_INET6 == addr->raw.family)
-        	addr->raw.family = PR_AF_INET6;
+    if (AF_INET6 == addr->raw.family)
+        addr->raw.family = PR_AF_INET6;
 #endif
-        PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
-        PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
-        return PR_SUCCESS;
-    }
+    PR_ASSERT(IsValidNetAddr(addr) == PR_TRUE);
+    PR_ASSERT(IsValidNetAddrLen(addr, addr_len) == PR_TRUE);
+    return PR_SUCCESS;
 }  /* pt_GetPeerName */
 
 static PRStatus pt_GetSocketOption(PRFileDesc *fd, PRSocketOptionData *data)
 {
     PRIntn rv;
     pt_SockLen length;
     PRInt32 level, name;
 
@@ -3708,18 +3706,18 @@ PR_IMPLEMENT(PRStatus) PR_Delete(const c
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = unlink(name);
 
     if (rv == -1) {
         pt_MapError(_PR_MD_MAP_UNLINK_ERROR, errno);
         return PR_FAILURE;
-    } else
-        return PR_SUCCESS;
+    }
+    return PR_SUCCESS;
 }  /* PR_Delete */
 
 PR_IMPLEMENT(PRStatus) PR_Access(const char *name, PRAccessHow how)
 {
     PRIntn rv;
 
     if (pt_TestAbort()) return PR_FAILURE;
 
@@ -3833,21 +3831,20 @@ PR_IMPLEMENT(PRStatus) PR_MkDir(const ch
 PR_IMPLEMENT(PRStatus) PR_RmDir(const char *name)
 {
     PRInt32 rv;
 
     if (pt_TestAbort()) return PR_FAILURE;
 
     rv = rmdir(name);
     if (0 == rv) {
-    return PR_SUCCESS;
-    } else {
+        return PR_SUCCESS;
+    }
     pt_MapError(_PR_MD_MAP_RMDIR_ERROR, errno);
     return PR_FAILURE;
-    }
 }  /* PR_Rmdir */
 
 
 PR_IMPLEMENT(PRDir*) PR_OpenDir(const char *name)
 {
     DIR *osdir;
     PRDir *dir = NULL;