From 69496f4afdfd7f97d555ae0be4fb0e3c3576512b Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Tue, 12 Apr 2022 16:09:18 +0100 Subject: [PATCH] LibWeb: Make Declaration.m_name a FlyString --- Userland/Libraries/LibWeb/CSS/Parser/Declaration.h | 4 ++-- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h index e180b7d197..d1de702822 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h +++ b/Userland/Libraries/LibWeb/CSS/Parser/Declaration.h @@ -20,14 +20,14 @@ public: Declaration(); ~Declaration(); - String const& name() const { return m_name; } + StringView name() const { return m_name; } Vector const& values() const { return m_values; } Important importance() const { return m_important; } String to_string() const; private: - String m_name; + FlyString m_name; Vector m_values; Important m_important { Important::No }; }; diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index efebe42283..1bbd9c5a71 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2517,7 +2517,7 @@ RefPtr Parser::convert_to_style_declaration(V Optional Parser::convert_to_style_property(Declaration const& declaration) { - auto& property_name = declaration.name(); + auto property_name = declaration.name(); auto property_id = property_id_from_string(property_name); if (property_id == PropertyID::Invalid) {