mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Bug 1185763 - Part 4: Swap elements if possible in r-value version of nsTArray::AppendElements. r=froydnj
This commit is contained in:
parent
2b4a52cf2e
commit
0527ccb54c
@ -1544,6 +1544,11 @@ public:
|
||||
elem_type* AppendElements(nsTArray_Impl<Item, Allocator>&& aArray)
|
||||
{
|
||||
MOZ_ASSERT(&aArray != this, "argument must be different aArray");
|
||||
if (Length() == 0) {
|
||||
SwapElements(aArray);
|
||||
return Elements();
|
||||
}
|
||||
|
||||
index_type len = Length();
|
||||
index_type otherLen = aArray.Length();
|
||||
if (!Alloc::Successful(this->template EnsureCapacity<Alloc>(
|
||||
|
Loading…
Reference in New Issue
Block a user