зеркало из https://github.com/mozilla/gecko-dev.git
Bug 968520 - Use FallibleTArray::Clear instead of SetLength(0). r=froydnj
This preemptively fixes the upcoming -Wunused-result warnings due to unchecked SetLength calls.
This commit is contained in:
Родитель
ba19e64cd5
Коммит
ea4a3be55c
|
@ -377,7 +377,7 @@ WebGLElementArrayCacheTree<T>::Update(size_t firstByte, size_t lastByte)
|
|||
if (requiredNumLeaves != NumLeaves()) {
|
||||
// See class comment for why we the tree storage size is 2 * numLeaves.
|
||||
if (!mTreeData.SetLength(2 * requiredNumLeaves, fallible)) {
|
||||
mTreeData.SetLength(0);
|
||||
mTreeData.Clear();
|
||||
return false;
|
||||
}
|
||||
MOZ_ASSERT(NumLeaves() == requiredNumLeaves);
|
||||
|
@ -471,7 +471,7 @@ WebGLElementArrayCache::BufferData(const void* ptr, size_t byteLength)
|
|||
{
|
||||
if (mBytes.Length() != byteLength) {
|
||||
if (!mBytes.SetLength(byteLength, fallible)) {
|
||||
mBytes.SetLength(0);
|
||||
mBytes.Clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ CryptoBuffer::Assign(const ArrayBufferViewOrArrayBuffer& aData)
|
|||
|
||||
// If your union is uninitialized, something's wrong
|
||||
MOZ_ASSERT(false);
|
||||
SetLength(0);
|
||||
Clear();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ CryptoBuffer::Assign(const OwningArrayBufferViewOrArrayBuffer& aData)
|
|||
|
||||
// If your union is uninitialized, something's wrong
|
||||
MOZ_ASSERT(false);
|
||||
SetLength(0);
|
||||
Clear();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче