mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:37:37 +00:00
LibJS: Avoid unnecessary HashMap growth in Interpreter::enter_scope()
Don't bother pre-allocating a hash map if we're not gonna put anything into it anyway.
This commit is contained in:
parent
5855b19ff3
commit
d294a3f54a
1 changed files with 3 additions and 1 deletions
|
@ -113,7 +113,9 @@ void Interpreter::enter_scope(const ScopeNode& scope_node, ScopeType scope_type,
|
|||
}
|
||||
|
||||
HashMap<FlyString, Variable> scope_variables_with_declaration_kind;
|
||||
scope_variables_with_declaration_kind.ensure_capacity(16);
|
||||
|
||||
if (!scope_node.variables().is_empty())
|
||||
scope_variables_with_declaration_kind.ensure_capacity(16);
|
||||
|
||||
bool is_program_node = is<Program>(scope_node);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue