mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 01:45:07 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue