mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 21:45:20 +00:00
LibJS: Pre-size a HashTable in function_declaration_instantiation()
The dynamic resizing of this hash table was showing up in profiles. Since we have an idea of how big it will get, use ensure_capacity().
This commit is contained in:
parent
70e25deea3
commit
b00b461b31
Notes:
sideshowbarker
2024-07-18 02:56:04 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/b00b461b317
1 changed files with 2 additions and 0 deletions
|
@ -287,6 +287,8 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
|||
Environment* var_environment;
|
||||
|
||||
HashTable<FlyString> instantiated_var_names;
|
||||
if (scope_body)
|
||||
instantiated_var_names.ensure_capacity(scope_body->var_declaration_count());
|
||||
|
||||
if (!has_parameter_expressions) {
|
||||
if (scope_body) {
|
||||
|
|
Loading…
Add table
Reference in a new issue