From 3e9191936b6a0daad63a4ff0b9ebdae1dd84d593 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Sun, 24 Oct 2021 15:17:35 +0100 Subject: [PATCH] LibWeb: Remove now-unnecessary String copy when parsing CSS colors Color::from_string() now does a case-insensitive comparison of color names, so we don't need this copy. :^) --- Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 24acb508bf..b52e643a01 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -2088,7 +2088,7 @@ Optional Parser::parse_color(ParsingContext const& context, StyleComponen if (component_value.is(Token::Type::Ident)) { auto ident = component_value.token().ident(); - auto color = Color::from_string(ident.to_lowercase_string()); + auto color = Color::from_string(ident); if (color.has_value()) return color;