From 44e1a45b2aac6b6c8807b157ae5e2a81a67b2cf1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 7 Feb 2019 09:08:59 +0100 Subject: [PATCH] AK: Optimize Vector::append(Vector&&) for case where this->m_impl is null. --- AK/Vector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AK/Vector.h b/AK/Vector.h index 575965daee..2870f90671 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -172,6 +172,10 @@ public: void append(Vector&& other) { + if (!m_impl) { + m_impl = move(other.m_impl); + return; + } Vector tmp = move(other); ensure_capacity(size() + tmp.size()); for (auto&& v : tmp) {