mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibWeb: Use StringBuilder::append_code_point() over append(Utf32View)
When appending a single Unicode code point, we don't have to go through the trouble of creating a Utf32View wrapper over it.
This commit is contained in:
parent
1a46d8df5f
commit
7892ee355d
Notes:
github-actions[bot]
2024-07-20 13:36:35 +00:00
Author: https://github.com/awesomekling
Commit: 7892ee355d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/735
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 3 additions and 3 deletions
|
@ -1155,17 +1155,17 @@ void HTMLParser::insert_character(u32 data)
|
|||
{
|
||||
auto node = find_character_insertion_node();
|
||||
if (node == m_character_insertion_node.ptr()) {
|
||||
m_character_insertion_builder.append(Utf32View { &data, 1 });
|
||||
m_character_insertion_builder.append_code_point(data);
|
||||
return;
|
||||
}
|
||||
if (!m_character_insertion_node.ptr()) {
|
||||
m_character_insertion_node = JS::make_handle(node);
|
||||
m_character_insertion_builder.append(Utf32View { &data, 1 });
|
||||
m_character_insertion_builder.append_code_point(data);
|
||||
return;
|
||||
}
|
||||
flush_character_insertions();
|
||||
m_character_insertion_node = JS::make_handle(node);
|
||||
m_character_insertion_builder.append(Utf32View { &data, 1 });
|
||||
m_character_insertion_builder.append_code_point(data);
|
||||
}
|
||||
|
||||
void HTMLParser::handle_after_head(HTMLToken& token)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue