mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Optimize Vector::append(Vector&&) for case where this->m_impl is null.
This commit is contained in:
parent
443d1c2237
commit
44e1a45b2a
Notes:
sideshowbarker
2024-07-19 15:50:34 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/44e1a45b2aa
@ -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 New Issue
Block a user