1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:28:11 +00:00

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. :^)
This commit is contained in:
Sam Atkins 2021-10-24 15:17:35 +01:00 committed by Andreas Kling
parent 094dc04695
commit 3e9191936b

View file

@ -2088,7 +2088,7 @@ Optional<Color> 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;