forked from mirrors/gecko-dev
Bug 1857751 - nsTSubstring.cpp: Do not use 'else' after 'return'. r=sylvestre
Differential Revision: https://phabricator.services.mozilla.com/D191019
This commit is contained in:
parent
5dc67ae3c7
commit
8b0d915b69
1 changed files with 5 additions and 6 deletions
|
|
@ -516,7 +516,8 @@ bool nsTSubstring<T>::Assign(const self_type& aStr,
|
|||
// get an owning reference to the this->mData
|
||||
nsStringBuffer::FromData(this->mData)->AddRef();
|
||||
return true;
|
||||
} else if (aStr.mDataFlags & DataFlags::LITERAL) {
|
||||
}
|
||||
if (aStr.mDataFlags & DataFlags::LITERAL) {
|
||||
MOZ_ASSERT(aStr.mDataFlags & DataFlags::TERMINATED, "Unterminated literal");
|
||||
|
||||
AssignLiteral(aStr.mData, aStr.mLength);
|
||||
|
|
@ -1347,16 +1348,14 @@ int_type ToIntegerCommon(const nsTSubstring<T>& aSrc, nsresult* aErrorCode,
|
|||
if (10 == aRadix) {
|
||||
// Invalid base 10 digit, error out.
|
||||
return 0;
|
||||
} else {
|
||||
result = (aRadix * result) + ((theChar - 'A') + 10);
|
||||
}
|
||||
result = (aRadix * result) + ((theChar - 'A') + 10);
|
||||
} else if ((theChar >= 'a') && (theChar <= 'f')) {
|
||||
if (10 == aRadix) {
|
||||
// Invalid base 10 digit, error out.
|
||||
return 0;
|
||||
} else {
|
||||
result = (aRadix * result) + ((theChar - 'a') + 10);
|
||||
}
|
||||
result = (aRadix * result) + ((theChar - 'a') + 10);
|
||||
} else if ((('X' == theChar) || ('x' == theChar)) && result == 0) {
|
||||
// For some reason we support a leading 'x' regardless of radix. For
|
||||
// example: "000000x500", aRadix = 10 would be parsed as 500 rather
|
||||
|
|
|
|||
Loading…
Reference in a new issue