From 3ede1d08f5fdfe3e47fff3b76288ce4ed170a568 Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Fri, 28 May 2021 20:53:40 +0200 Subject: [PATCH] LibWeb: Avoid unnecessary String copy in parsing CSS custom properties --- Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp index ac6ae7cd84..591de141a6 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp @@ -217,7 +217,7 @@ static bool takes_integer_value(CSS::PropertyID property_id) return property_id == CSS::PropertyID::ZIndex || property_id == CSS::PropertyID::FontWeight || property_id == CSS::PropertyID::Custom; } -static StringView parse_custom_property_name(StringView value) +static StringView parse_custom_property_name(const StringView& value) { if (!value.starts_with("var(") && !value.ends_with(")")) return {};