mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-18 07:22:22 +00:00
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:
parent
4d3f764d95
commit
fd5ee06bbf
Notes:
github-actions[bot]
2024-10-12 21:00:59 +00:00
Author: https://github.com/alimpfard
Commit: fd5ee06bbf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1751
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ private:
|
||||||
{
|
{
|
||||||
auto error = ParseError { forward<Ts>(args)... };
|
auto error = ParseError { forward<Ts>(args)... };
|
||||||
if (m_current_rule.accept) {
|
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))
|
if (rule_name.starts_with("parse_"sv))
|
||||||
rule_name = rule_name.substring_view(6);
|
rule_name = rule_name.substring_view(6);
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ private:
|
||||||
bool m_standalone { false };
|
bool m_standalone { false };
|
||||||
HashMap<Name, ByteString> m_processing_instructions;
|
HashMap<Name, ByteString> m_processing_instructions;
|
||||||
struct AcceptedRule {
|
struct AcceptedRule {
|
||||||
Optional<ByteString> rule {};
|
Optional<StringView> rule {};
|
||||||
bool accept { false };
|
bool accept { false };
|
||||||
} m_current_rule {};
|
} m_current_rule {};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue