mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-28 18:40:29 +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: https://github.com/LadybirdBrowser/ladybird/commit/fd5ee06bbf4 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)... };
|
||||
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 {};
|
||||
|
||||
|
|
Loading…
Reference in a new issue