LibJS: Pass unwinding target labels a bit more efficiently

Use const reference or move semantics when passing these labels.
This commit is contained in:
Andreas Kling 2021-06-06 11:40:41 +02:00
parent e24f1dfbe1
commit f290048662
Notes: sideshowbarker 2024-07-18 12:46:40 +09:00

View file

@ -166,14 +166,14 @@ public:
void unwind(ScopeType type, FlyString label = {})
{
m_unwind_until = type;
m_unwind_until_label = label;
m_unwind_until_label = move(label);
}
void stop_unwind()
{
m_unwind_until = ScopeType::None;
m_unwind_until_label = {};
}
bool should_unwind_until(ScopeType type, FlyString label = {}) const
bool should_unwind_until(ScopeType type, FlyString const& label) const
{
if (m_unwind_until_label.is_null())
return m_unwind_until == type;