mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 969864 - Make nsTArray::SetLength return void; r=froydnj
This commit is contained in:
parent
6ff96ec5c2
commit
ad09f563e0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user