1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:17:35 +00:00

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

View file

@ -166,14 +166,14 @@ public:
void unwind(ScopeType type, FlyString label = {}) void unwind(ScopeType type, FlyString label = {})
{ {
m_unwind_until = type; m_unwind_until = type;
m_unwind_until_label = label; m_unwind_until_label = move(label);
} }
void stop_unwind() void stop_unwind()
{ {
m_unwind_until = ScopeType::None; m_unwind_until = ScopeType::None;
m_unwind_until_label = {}; 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()) if (m_unwind_until_label.is_null())
return m_unwind_until == type; return m_unwind_until == type;