Bug 1338086 - Remove useless else blocks in order to reduce complexity in uriloader/exthandler/unix/ r?froydnj
MozReview-Commit-ID: HvmyxEwsnrg
--- a/uriloader/exthandler/unix/nsOSHelperAppService.cpp
+++ b/uriloader/exthandler/unix/nsOSHelperAppService.cpp
@@ -568,17 +568,18 @@ nsOSHelperAppService::GetExtensionsAndDe
Substring(minorTypeStart,
minorTypeEnd).Equals(aMinorType,
nsCaseInsensitiveStringComparator())) {
// it's a match
aFileExtensions.Assign(extensions);
aDescription.Assign(Substring(descriptionStart, descriptionEnd));
mimeFile->Close();
return NS_OK;
- } else if (NS_FAILED(rv)) {
+ }
+ if (NS_FAILED(rv)) {
LOG(("Failed to parse entry: %s\n", NS_LossyConvertUTF16toASCII(entry).get()));
}
entry.Truncate();
}
}
if (!more) {
rv = NS_ERROR_NOT_AVAILABLE;
@@ -1108,21 +1109,21 @@ nsOSHelperAppService::GetHandlerAndDescr
}
}
if (match) { // we did not fail any test clauses; all is good
// get out of here
mailcapFile->Close();
return NS_OK;
- } else { // pretend that this match never happened
- aDescription.Truncate();
- aMozillaFlags.Truncate();
- aHandler.Truncate();
}
+ // pretend that this match never happened
+ aDescription.Truncate();
+ aMozillaFlags.Truncate();
+ aHandler.Truncate();
}
}
// zero out the entry for the next cycle
entry.Truncate();
}
}
if (!more) {
rv = NS_ERROR_NOT_AVAILABLE;