Bug 1338086 - Remove useless else blocks in order to reduce complexity in modules/libjar/ r?froydnj
MozReview-Commit-ID: LvDRxqoEAoY
--- 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;
}
}