mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 06:27:45 +00:00
AK: Optimize Vector::append(Vector&&) for case where this->m_impl is null.
This commit is contained in:
parent
443d1c2237
commit
44e1a45b2a
1 changed files with 4 additions and 0 deletions
|
@ -172,6 +172,10 @@ public:
|
|||
|
||||
void append(Vector<T>&& other)
|
||||
{
|
||||
if (!m_impl) {
|
||||
m_impl = move(other.m_impl);
|
||||
return;
|
||||
}
|
||||
Vector<T> tmp = move(other);
|
||||
ensure_capacity(size() + tmp.size());
|
||||
for (auto&& v : tmp) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue