1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:57:35 +00:00

LibWeb: Return FlyString from CSS::Parser::Token::ident

Instead of a StringView. This allows us to preserve the nice O(1) string
compare property of FlyString, and not needing to allocate when one is
needed.

Ideally all other places in Token should have similar changes done, but
to prevent a huge amount of churn, just change ident for now.
This commit is contained in:
Shannon Booth 2023-11-07 00:22:33 +13:00 committed by Andreas Kling
parent 8c8ea86729
commit 3f13a50a20
4 changed files with 19 additions and 19 deletions

View file

@ -59,10 +59,10 @@ public:
Type type() const { return m_type; }
bool is(Type type) const { return m_type == type; }
StringView ident() const
FlyString const& ident() const
{
VERIFY(m_type == Type::Ident);
return m_value.bytes_as_string_view();
return m_value;
}
StringView function() const