mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 21:12:08 +02:00
LibWeb: Use FlyString attribute name comparisons in encoding detection
Prevent some unnecessary work by performing pointer comparisons.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
4ebbbdfef1
commit
4bcf988e46
Notes:
github-actions[bot]
2025-11-21 16:44:21 +00:00
Author: https://github.com/gmta Commit: https://github.com/LadybirdBrowser/ladybird/commit/4bcf988e46b Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6893
@@ -295,15 +295,15 @@ Optional<ByteString> run_prescan_byte_stream_algorithm(DOM::Document& document,
|
||||
auto const& attribute_name = attribute->name();
|
||||
attribute_list.append(attribute->name());
|
||||
|
||||
if (attribute_name == "http-equiv") {
|
||||
if (attribute_name == AttributeNames::http_equiv) {
|
||||
got_pragma = attribute->value() == "content-type";
|
||||
} else if (attribute_name == "content") {
|
||||
} else if (attribute_name == AttributeNames::content) {
|
||||
auto encoding = extract_character_encoding_from_meta_element(attribute->value().to_byte_string());
|
||||
if (encoding.has_value() && !charset.has_value()) {
|
||||
charset = encoding.value();
|
||||
need_pragma = true;
|
||||
}
|
||||
} else if (attribute_name == "charset") {
|
||||
} else if (attribute_name == AttributeNames::charset) {
|
||||
auto maybe_charset = TextCodec::get_standardized_encoding(attribute->value());
|
||||
if (maybe_charset.has_value()) {
|
||||
charset = Optional<ByteString> { maybe_charset };
|
||||
|
||||
Reference in New Issue
Block a user