Просмотр исходного кода

HackStudio: Tighten some unnecessarily broad lambda captures

Andreas Kling 4 лет назад
Родитель
Сommit
ad7030ce4a

+ 5 - 5
DevTools/HackStudio/Debugger/DebugInfoWidget.cpp

@@ -45,28 +45,28 @@ namespace HackStudio {
 
 void DebugInfoWidget::init_toolbar()
 {
-    m_continue_action = GUI::Action::create("Continue", Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-continue.png"), [&](auto&) {
+    m_continue_action = GUI::Action::create("Continue", Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-continue.png"), [](auto&) {
         pthread_mutex_lock(Debugger::the().continue_mutex());
         Debugger::the().set_continue_type(Debugger::ContinueType::Continue);
         pthread_cond_signal(Debugger::the().continue_cond());
         pthread_mutex_unlock(Debugger::the().continue_mutex());
     });
 
-    m_singlestep_action = GUI::Action::create("Step Over", { Mod_None, Key_F10 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-over.png"), [&](auto&) {
+    m_singlestep_action = GUI::Action::create("Step Over", { Mod_None, Key_F10 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-over.png"), [](auto&) {
         pthread_mutex_lock(Debugger::the().continue_mutex());
         Debugger::the().set_continue_type(Debugger::ContinueType::SourceStepOver);
         pthread_cond_signal(Debugger::the().continue_cond());
         pthread_mutex_unlock(Debugger::the().continue_mutex());
     });
 
-    m_step_in_action = GUI::Action::create("Step In", { Mod_None, Key_F11 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-in.png"), [&](auto&) {
+    m_step_in_action = GUI::Action::create("Step In", { Mod_None, Key_F11 }, Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-in.png"), [](auto&) {
         pthread_mutex_lock(Debugger::the().continue_mutex());
         Debugger::the().set_continue_type(Debugger::ContinueType::SourceSingleStep);
         pthread_cond_signal(Debugger::the().continue_cond());
         pthread_mutex_unlock(Debugger::the().continue_mutex());
     });
 
-    m_step_out_action = GUI::Action::create("Step Out", { Mod_Shift, Key_F11 },Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-out.png"), [&](auto&) {
+    m_step_out_action = GUI::Action::create("Step Out", { Mod_Shift, Key_F11 },Gfx::Bitmap::load_from_file("/res/icons/16x16/debug-step-out.png"), [](auto&) {
         pthread_mutex_lock(Debugger::the().continue_mutex());
         Debugger::the().set_continue_type(Debugger::ContinueType::SourceStepOut);
         pthread_cond_signal(Debugger::the().continue_cond());
@@ -144,7 +144,7 @@ NonnullRefPtr<GUI::Widget> DebugInfoWidget::build_variables_tab()
         }
     };
 
-    auto edit_variable_action = GUI::Action::create("Change value", [&](auto&) {
+    auto edit_variable_action = GUI::Action::create("Change value", [this](auto&) {
         m_variables_view->on_activation(m_variables_view->selection().first());
     });
 

+ 1 - 1
DevTools/HackStudio/Debugger/Debugger.cpp

@@ -130,7 +130,7 @@ int Debugger::debugger_loop()
 {
     ASSERT(m_debug_session);
 
-    m_debug_session->run([&](Debug::DebugSession::DebugBreakReason reason, Optional<PtraceRegisters> optional_regs) {
+    m_debug_session->run([this](Debug::DebugSession::DebugBreakReason reason, Optional<PtraceRegisters> optional_regs) {
         if (reason == Debug::DebugSession::DebugBreakReason::Exited) {
             dbg() << "Program exited";
             m_on_exit_callback();