зеркало из https://github.com/mozilla/gecko-dev.git
Bug 969864 - Make nsTArray::SetLength return void; r=froydnj
This commit is contained in:
Родитель
8c745c4061
Коммит
c1dc0a9245
|
@ -262,7 +262,8 @@ nsCOMArray_base::SetCount(int32_t aNewCount)
|
|||
int32_t count = mArray.Length();
|
||||
if (count > aNewCount)
|
||||
RemoveObjectsAt(aNewCount, mArray.Length() - aNewCount);
|
||||
return mArray.SetLength(aNewCount);
|
||||
mArray.SetLength(aNewCount);
|
||||
return true;
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
@ -1388,14 +1388,14 @@ public:
|
|||
// @return True if the operation succeeded; false otherwise.
|
||||
// See also TruncateLength if the new length is guaranteed to be
|
||||
// smaller than the old.
|
||||
bool SetLength(size_type newLen) {
|
||||
typename Alloc::ResultType SetLength(size_type newLen) {
|
||||
size_type oldLen = Length();
|
||||
if (newLen > oldLen) {
|
||||
return InsertElementsAt(oldLen, newLen - oldLen) != nullptr;
|
||||
return Alloc::ConvertBoolToResultType(InsertElementsAt(oldLen, newLen - oldLen) != nullptr);
|
||||
}
|
||||
|
||||
TruncateLength(newLen);
|
||||
return true;
|
||||
return Alloc::ConvertBoolToResultType(true);
|
||||
}
|
||||
|
||||
// This method modifies the length of the array, but may only be
|
||||
|
|
Загрузка…
Ссылка в новой задаче