Bug 1338086 - Remove useless else blocks in order to reduce complexity in modules/libjar/ r?froydnj draft
authorSylvestre Ledru <sledru@mozilla.com>
Thu, 09 Feb 2017 10:54:30 +0100
changeset 484416 9b06e634b58f6aa1d79ad0e68e9df59bca1de848
parent 484415 a43087937bc3e974a5b8b2495f2c855a84bd3780
child 484417 63cd85675e8bbd936c36a670149c2b33fb3e9d85
push id45470
push userbmo:sledru@mozilla.com
push dateWed, 15 Feb 2017 08:57:47 +0000
reviewersfroydnj
bugs1338086
milestone54.0a1
Bug 1338086 - Remove useless else blocks in order to reduce complexity in modules/libjar/ r?froydnj MozReview-Commit-ID: LvDRxqoEAoY
modules/libjar/nsJAR.cpp
modules/libjar/nsZipArchive.cpp
--- a/modules/libjar/nsJAR.cpp
+++ b/modules/libjar/nsJAR.cpp
@@ -109,17 +109,17 @@ MozExternalRefCountType nsJAR::Release(v
   NS_LOG_RELEASE(this, count, "nsJAR");
   if (0 == count) {
     mRefCnt = 1; /* stabilize */
     /* enable this to find non-threadsafe destructors: */
     /* NS_ASSERT_OWNINGTHREAD(nsJAR); */
     delete this;
     return 0;
   }
-  else if (1 == count && mCache) {
+  if (1 == count && mCache) {
 #ifdef DEBUG
     nsresult rv =
 #endif
       mCache->ReleaseZip(this);
     NS_ASSERTION(NS_SUCCEEDED(rv), "failed to release zip file");
   }
   return count;
 }
--- a/modules/libjar/nsZipArchive.cpp
+++ b/modules/libjar/nsZipArchive.cpp
@@ -502,17 +502,18 @@ nsresult nsZipArchive::ExtractFile(nsZip
 
   while (true) {
     uint32_t count = 0;
     uint8_t* buf = cursor.Read(&count);
     if (!buf) {
       nsZipArchive::sFileCorruptedReason = "nsZipArchive: Read() failed to return a buffer";
       rv = NS_ERROR_FILE_CORRUPTED;
       break;
-    } else if (count == 0) {
+    }
+    if (count == 0) {
       break;
     }
 
     if (aFd && PR_Write(aFd, buf, count) < (READTYPE)count) {
       rv = NS_ERROR_FILE_DISK_FULL;
       break;
     }
   }