From 5455ecf650769ae903ed76b68fe0c7e0eb6c53f9 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Sat, 21 Oct 2023 16:57:50 +0100 Subject: [PATCH] LibGfx: Remove OpenType::Font::m_buffer At first glance this looks like it holds the memory that the various slices point into... but it actually doesn't own that memory. Nobody uses m_buffer, so it serves no purpose. --- Userland/Libraries/LibGfx/Font/OpenType/Font.cpp | 1 - Userland/Libraries/LibGfx/Font/OpenType/Font.h | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp index 0c20ca54e4..797bcef54d 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp +++ b/Userland/Libraries/LibGfx/Font/OpenType/Font.cpp @@ -278,7 +278,6 @@ ErrorOr> Font::try_load_from_offset(ReadonlyBytes buffer, u3 } return adopt_ref(*new Font( - move(buffer), move(head), move(name), move(hhea), diff --git a/Userland/Libraries/LibGfx/Font/OpenType/Font.h b/Userland/Libraries/LibGfx/Font/OpenType/Font.h index 3fa9f7d2c7..043e384d7a 100644 --- a/Userland/Libraries/LibGfx/Font/OpenType/Font.h +++ b/Userland/Libraries/LibGfx/Font/OpenType/Font.h @@ -82,7 +82,6 @@ private: static ErrorOr> try_load_from_offset(ReadonlyBytes, unsigned index = 0); Font( - ReadonlyBytes bytes, Head&& head, Name&& name, Hhea&& hhea, @@ -98,8 +97,7 @@ private: Optional cblc, Optional cbdt, Optional gpos) - : m_buffer(move(bytes)) - , m_head(move(head)) + : m_head(move(head)) , m_name(move(name)) , m_hhea(move(hhea)) , m_maxp(move(maxp)) @@ -119,8 +117,6 @@ private: RefPtr m_resource; - ReadonlyBytes m_buffer; - // These are stateful wrappers around non-owning slices Head m_head; Name m_name;