From 52a2518a69a12ff951f3c39d0bb8f1e3f2d2b0e8 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 16 Jul 2021 23:16:14 +0430 Subject: [PATCH] LibWasm: Remove a useless use of ScopeGuard There are no multiple exit paths in that function, so we can just put the ending logic right at the end of the function instead. --- .../AbstractMachine/BytecodeInterpreter.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp index 8db9b852dc..dedde43160 100644 --- a/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp +++ b/Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp @@ -1126,17 +1126,15 @@ void DebuggerBytecodeInterpreter::interpret(Configuration& configuration, Instru } } - ScopeGuard guard { [&] { - if (post_interpret_hook) { - auto result = post_interpret_hook(configuration, ip, instruction, *this); - if (!result) { - m_trap = Trap { "Trapped by user request" }; - return; - } - } - } }; - BytecodeInterpreter::interpret(configuration, ip, instruction); + + if (post_interpret_hook) { + auto result = post_interpret_hook(configuration, ip, instruction, *this); + if (!result) { + m_trap = Trap { "Trapped by user request" }; + return; + } + } } }