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
Родитель 364ecfb0c7
Коммит 5bedb078f1
4 изменённых файлов: 34 добавлений и 33 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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;
}
}

Просмотреть файл

@ -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);
}
#endif
}
@ -1965,9 +1964,10 @@ nsLocalFile::Reveal()
if (isDirectory) {
return giovfs->ShowURIForInput(mPath);
} else if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
}
if (NS_SUCCEEDED(giovfs->OrgFreedesktopFileManager1ShowItems(mPath))) {
return NS_OK;
} else {
}
nsCOMPtr<nsIFile> parentDir;
nsAutoCString dirPath;
if (NS_FAILED(GetParent(getter_AddRefs(parentDir)))) {
@ -1978,7 +1978,6 @@ nsLocalFile::Reveal()
}
return giovfs->ShowURIForInput(dirPath);
}
#elif defined(MOZ_WIDGET_COCOA)
CFURLRef url;
if (NS_SUCCEEDED(GetCFURL(&url))) {

Просмотреть файл

@ -74,25 +74,23 @@ PrepareAndDispatch(nsXPTCStubBase * self, uint32_t methodIndex,
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 (param.IsOut() || !type.IsArithmetic()) {
dp->val.p = (void*) value;