mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 01:41:59 -05: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…
Reference in a new issue