Bug 1338086 - Remove useless else blocks in order to reduce complexity in xpcom/ r=froydnj

MozReview-Commit-ID: JUJARn5Nspp

--HG--
extra : rebase_source : c719d19215fb26ace822269c2a28faf5cf35ffbb
This commit is contained in:
Sylvestre Ledru 2017-02-09 15:31:35 +01:00
parent 364ecfb0c7
commit 5bedb078f1
4 changed files with 34 additions and 33 deletions

View File

@ -182,7 +182,7 @@ FileLocation::Data::GetSize(uint32_t* aResult)
*aResult = fileInfo.size;
return NS_OK;
}
else if (mItem) {
if (mItem) {
*aResult = mItem->RealSize();
return NS_OK;
}
@ -203,7 +203,7 @@ FileLocation::Data::Copy(char* aBuf, uint32_t aLen)
}
return NS_OK;
}
else if (mItem) {
if (mItem) {
nsZipCursor cursor(mItem, mZip, reinterpret_cast<uint8_t*>(aBuf),
aLen, true);
uint32_t readLen;

View File

@ -219,7 +219,8 @@ nsAString::Compare(const char_type* aOther, ComparatorFunc aComparator) const
if (result == 0) {
if (selflen < otherlen) {
return -1;
} else if (selflen > otherlen) {
}
if (selflen > otherlen) {
return 1;
}
}
@ -239,7 +240,8 @@ nsAString::Compare(const self_type& aOther, ComparatorFunc aComparator) const
if (result == 0) {
if (selflen < otherlen) {
return -1;
} else if (selflen > otherlen) {
}
if (selflen > otherlen) {
return 1;
}
}
@ -758,7 +760,8 @@ nsACString::Compare(const char_type* aOther, ComparatorFunc aComparator) const
if (result == 0) {
if (selflen < otherlen) {
return -1;
} else if (selflen > otherlen) {
}
if (selflen > otherlen) {
return 1;
}
}
@ -778,7 +781,8 @@ nsACString::Compare(const self_type& aOther, ComparatorFunc aComparator) const
if (result == 0) {
if (selflen < otherlen) {
return -1;
} else if (selflen > otherlen) {
}
if (selflen > otherlen) {
return 1;
}
}

View File

@ -961,13 +961,12 @@ nsLocalFile::CopyToNative(nsIFile* aNewParent, const nsACString& aNewName)
if (bytesRead < 0) {
if (saved_write_error != NS_OK) {
return saved_write_error;
} else if (saved_read_error != NS_OK) {
}
if (saved_read_error != NS_OK) {
return saved_read_error;
}
#if DEBUG
else { // sanity check. Die and debug.
MOZ_ASSERT(0);
}
MOZ_ASSERT(0);
#endif
}
@ -1965,20 +1964,20 @@ nsLocalFile::Reveal()
if (isDirectory) {
return giovfs->ShowURIForInput(mPath);
} else if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
return NS_OK;
} else {
nsCOMPtr<nsIFile> parentDir;
nsAutoCString dirPath;
if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
return NS_ERROR_FAILURE;
}
if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
return NS_ERROR_FAILURE;
}
return giovfs->ShowURIForInput(dirPath);
}
if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
return NS_OK;
}
nsCOMPtr<nsIFile> parentDir;
nsAutoCString dirPath;
if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
return NS_ERROR_FAILURE;
}
if (NS_FAILED(parentDir->GetNativePath(dirPath))) {
return NS_ERROR_FAILURE;
}
return giovfs->ShowURIForInput(dirPath);
#elif defined(MOZ_WIDGET_COCOA)
CFURLRef url;
if (NS_SUCCEEDED(GetCFURL(&url))) {

View File

@ -69,30 +69,28 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
const nsXPTParamInfo& param = info->GetParam(i);
const nsXPTType& type = param.GetType();
nsXPTCMiniVariant* dp = &dispatchParams[i];
if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
if (nr_fpr < FPR_COUNT)
dp->val.d = fpregs[nr_fpr++];
else
dp->val.d = *(double*) ap++;
dp->val.d = *(double*)ap++;
continue;
}
else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
if (nr_fpr < FPR_COUNT)
// The value in %xmm register is already prepared to
// be retrieved as a float. Therefore, we pass the
// value verbatim, as a double without conversion.
dp->val.d = fpregs[nr_fpr++];
else
dp->val.f = *(float*) ap++;
dp->val.f = *(float*)ap++;
continue;
}
else {
if (nr_gpr < GPR_COUNT)
value = gpregs[nr_gpr++];
else
value = *ap++;
}
if (nr_gpr < GPR_COUNT)
value = gpregs[nr_gpr++];
else
value = *ap++;
if (param.IsOut() || !type.IsArithmetic()) {
dp->val.p = (void*) value;