mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibJS: Pre-size the hash map and vector used in ensure_property_table()
This commit is contained in:
parent
b7975abef8
commit
ad0d377e4c
Notes:
sideshowbarker
2024-07-19 02:03:35 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ad0d377e4c6
1 changed files with 2 additions and 1 deletions
|
@ -148,10 +148,11 @@ void Shape::ensure_property_table() const
|
|||
if (m_property_table)
|
||||
return;
|
||||
m_property_table = make<HashMap<StringOrSymbol, PropertyMetadata>>();
|
||||
m_property_table->ensure_capacity(m_property_count);
|
||||
|
||||
DeferGC defer(heap());
|
||||
|
||||
Vector<const Shape*> transition_chain;
|
||||
Vector<const Shape*, 64> transition_chain;
|
||||
for (auto* shape = this; shape->m_previous; shape = shape->m_previous) {
|
||||
transition_chain.append(shape);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue