LibXML: Avoid allocating ByteStrings for AcceptedRule

These come from string literals and compiletime-known values, no need to
allocate a ByteString.
This commit is contained in:
Ali Mohammad Pur 2024-10-12 22:33:06 +02:00 committed by Andreas Kling
parent 4d3f764d95
commit fd5ee06bbf
Notes: github-actions[bot] 2024-10-12 21:00:59 +00:00

View file

@ -184,7 +184,7 @@ private:
{
auto error = ParseError { forward<Ts>(args)... };
if (m_current_rule.accept) {
auto rule_name = m_current_rule.rule.value_or("<?>");
auto rule_name = m_current_rule.rule.value_or("<?>"sv);
if (rule_name.starts_with("parse_"sv))
rule_name = rule_name.substring_view(6);
@ -212,7 +212,7 @@ private:
bool m_standalone { false };
HashMap<Name, ByteString> m_processing_instructions;
struct AcceptedRule {
Optional<ByteString> rule {};
Optional<StringView> rule {};
bool accept { false };
} m_current_rule {};