mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibJS: Make Parser::ScopePusher::has_declaration() take FlyString
Everyone who calls this already has a FlyString, so we were doing *way* more work by pessimizing it to a StringView. This gives a ~2% speedup when parsing the largest Discord JS file.
This commit is contained in:
parent
3d9f2e2f94
commit
1a3fa2d88b
1 changed files with 1 additions and 1 deletions
|
@ -190,7 +190,7 @@ public:
|
|||
ScopePusher* parent_scope() { return m_parent_scope; }
|
||||
ScopePusher const* parent_scope() const { return m_parent_scope; }
|
||||
|
||||
[[nodiscard]] bool has_declaration(StringView name) const
|
||||
[[nodiscard]] bool has_declaration(FlyString const& name) const
|
||||
{
|
||||
return m_lexical_names.contains(name) || m_var_names.contains(name) || !m_functions_to_hoist.find_if([&name](auto& function) { return function->name() == name; }).is_end();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue