mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 17:55:08 +00:00
LibTextCodec: Don't allocate Strings on encoding normalisation
This ripples down to LibWeb's HTML and XHR decoders, which therefore become less allocation heavy.
This commit is contained in:
parent
820e03e8d4
commit
6a95df2526
6 changed files with 48 additions and 48 deletions
|
@ -34,7 +34,7 @@ bool prescan_skip_whitespace_and_slashes(const ByteBuffer& input, size_t& positi
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#algorithm-for-extracting-a-character-encoding-from-a-meta-element
|
||||
Optional<String> extract_character_encoding_from_meta_element(String const& string)
|
||||
Optional<StringView> extract_character_encoding_from_meta_element(String const& string)
|
||||
{
|
||||
// Checking for "charset" is case insensitive, as is getting an encoding.
|
||||
// Therefore, stick to lowercase from the start for simplicity.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue