mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:18:11 +00:00
LibWeb: Store HTML tag name token data as FlyString while parsing
This makes checking if a token is a specific tag O(1) instead of O(n).
This commit is contained in:
parent
d39f4edc99
commit
97ca45d9c6
1 changed files with 3 additions and 3 deletions
|
@ -134,7 +134,7 @@ public:
|
|||
m_data.get<u32>() = code_point;
|
||||
}
|
||||
|
||||
String const& comment() const
|
||||
FlyString const& comment() const
|
||||
{
|
||||
VERIFY(is_comment());
|
||||
return m_string_data;
|
||||
|
@ -146,7 +146,7 @@ public:
|
|||
m_string_data = move(comment);
|
||||
}
|
||||
|
||||
String const& tag_name() const
|
||||
FlyString const& tag_name() const
|
||||
{
|
||||
VERIFY(is_start_tag() || is_end_tag());
|
||||
return m_string_data;
|
||||
|
@ -350,7 +350,7 @@ private:
|
|||
bool m_tag_self_closing_acknowledged { false };
|
||||
|
||||
// Type::Comment (comment data), Type::StartTag and Type::EndTag (tag name)
|
||||
String m_string_data;
|
||||
FlyString m_string_data;
|
||||
|
||||
Variant<Empty, u32, OwnPtr<DoctypeData>, OwnPtr<Vector<Attribute>>> m_data {};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue