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:
Hendiadyoin1 2022-03-21 00:09:28 +01:00 committed by Andreas Kling
commit 6a95df2526
Notes: sideshowbarker 2024-07-17 17:00:47 +09:00
6 changed files with 48 additions and 48 deletions

View file

@ -80,7 +80,7 @@ public:
};
Decoder* decoder_for(String const& encoding);
Optional<String> get_standardized_encoding(const String& encoding);
Optional<StringView> get_standardized_encoding(StringView encoding);
// This returns the appropriate Unicode decoder for the sniffed BOM or nullptr if there is no appropriate decoder.
Decoder* bom_sniff_to_decoder(StringView);