瀏覽代碼

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.
Ali Mohammad Pur 4 年之前
父節點
當前提交
52a2518a69
共有 1 個文件被更改,包括 8 次插入10 次删除
  1. 8 10
      Userland/Libraries/LibWasm/AbstractMachine/BytecodeInterpreter.cpp

+ 8 - 10
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;
+        }
+    }
 }
 
 }