mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
LibJS: Shrink DeclarativeEnvironment bindings vector to fit
After setting up all the bindings in function_declaration_instantiation, we now ask DeclarativeEnvironment to do a shrink_to_fit() on its vector of bindings. This ends up saving 5.6 MiB on twitter.com/awesomekling :^)
This commit is contained in:
parent
d77ce7bae9
commit
2e98c17347
Notes:
sideshowbarker
2024-07-17 03:36:30 +09:00
Author: https://github.com/awesomekling
Commit: 2e98c17347
Pull-request: https://github.com/SerenityOS/serenity/pull/16215
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/trflynn89
3 changed files with 12 additions and 0 deletions
|
@ -231,4 +231,9 @@ void DeclarativeEnvironment::initialize_or_set_mutable_binding(Badge<ScopeNode>,
|
|||
MUST(initialize_or_set_mutable_binding(vm, name, value));
|
||||
}
|
||||
|
||||
void DeclarativeEnvironment::shrink_to_fit()
|
||||
{
|
||||
m_bindings.shrink_to_fit();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue