1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:27:34 +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:
Hendiadyoin1 2022-03-21 00:09:28 +01:00 committed by Andreas Kling
parent 820e03e8d4
commit 6a95df2526
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);