From f290048662d077d843079ff21277d77bf0f79341 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Jun 2021 11:40:41 +0200 Subject: [PATCH] LibJS: Pass unwinding target labels a bit more efficiently Use const reference or move semantics when passing these labels. --- Userland/Libraries/LibJS/Runtime/VM.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 481aec676a5..74c2bd96d51 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -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;