mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
LibWeb: Avoid some heap churn during text splitting
Use Vector capacity while splitting text into chunks (to avoid many small heap allocations.)
This commit is contained in:
parent
7d8a9bdb1e
commit
1e92081546
Notes:
sideshowbarker
2024-07-19 01:19:47 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1e920815466
@ -231,7 +231,7 @@ void LayoutText::split_into_lines_by_rules(LayoutBlock& container, LayoutMode la
|
||||
bool is_break { false };
|
||||
bool is_all_whitespace { false };
|
||||
};
|
||||
Vector<Chunk> chunks;
|
||||
Vector<Chunk, 128> chunks;
|
||||
|
||||
for_each_chunk(
|
||||
[&](const Utf8View& view, int start, int length, bool is_break, bool is_all_whitespace) {
|
||||
|
Loading…
Reference in New Issue
Block a user