1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +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

@ -15,7 +15,7 @@ namespace Web::HTML {
bool prescan_should_abort(const ByteBuffer& input, const size_t& position);
bool prescan_is_whitespace_or_slash(const u8& byte);
bool prescan_skip_whitespace_and_slashes(const ByteBuffer& input, size_t& position);
Optional<String> extract_character_encoding_from_meta_element(String const&);
Optional<StringView> extract_character_encoding_from_meta_element(String const&);
RefPtr<DOM::Attribute> prescan_get_attribute(DOM::Document&, const ByteBuffer& input, size_t& position);
Optional<String> run_prescan_byte_stream_algorithm(DOM::Document&, const ByteBuffer& input);
String run_encoding_sniffing_algorithm(DOM::Document&, const ByteBuffer& input);