From 39c09cec88582030668e3ab00516ccd146559446 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sun, 30 May 2021 19:31:32 +0200 Subject: [PATCH] LibGfx: Elide predictable reallocations in GIF loader --- Userland/Libraries/LibGfx/GIFLoader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibGfx/GIFLoader.cpp b/Userland/Libraries/LibGfx/GIFLoader.cpp index 3ed4066195..f1d716a485 100644 --- a/Userland/Libraries/LibGfx/GIFLoader.cpp +++ b/Userland/Libraries/LibGfx/GIFLoader.cpp @@ -228,9 +228,9 @@ public: private: void init_code_table() { - m_code_table.clear(); + m_code_table.ensure_capacity(m_table_capacity); for (u16 i = 0; i < m_table_capacity; ++i) { - m_code_table.append({ (u8)i }); + m_code_table.unchecked_append({ (u8)i }); } m_original_code_table = m_code_table; }