diff options
| author | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2024-09-21 14:50:23 -0700 |
|---|---|---|
| committer | mitaclaw <140017135+mitaclaw@users.noreply.github.com> | 2025-01-01 09:52:03 -0800 |
| commit | d92c68e1de481b509d92bbdd68f83c9a92f254aa (patch) | |
| tree | f0d502704016a0e79e5bafbb052a3e2e1b09b764 /Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | |
| parent | 110d32729ecbe5b19df9b2cc76de630334410589 (diff) | |
Simplify `std::find_if` with `Common::Contains`
Diffstat (limited to 'Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp index 2737cb22ff..2c59e86f69 100644 --- a/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt/Debugger/BreakpointWidget.cpp @@ -16,6 +16,7 @@ #include <QToolBar> #include <QVBoxLayout> +#include "Common/Contains.h" #include "Common/FileUtil.h" #include "Common/IniFile.h" #include "Core/ConfigManager.h" @@ -522,10 +523,7 @@ void BreakpointWidget::OnContextMenu(const QPoint& pos) if (!is_memory_breakpoint) { const auto& inst_breakpoints = m_system.GetPowerPC().GetBreakPoints().GetBreakPoints(); - const auto bp_iter = - std::find_if(inst_breakpoints.begin(), inst_breakpoints.end(), - [bp_address](const auto& bp) { return bp.address == bp_address; }); - if (bp_iter == inst_breakpoints.end()) + if (!Common::Contains(inst_breakpoints, bp_address, &TBreakPoint::address)) return; menu->addAction(tr("Show in Code"), [this, bp_address] { emit ShowCode(bp_address); }); @@ -538,10 +536,7 @@ void BreakpointWidget::OnContextMenu(const QPoint& pos) else { const auto& memory_breakpoints = m_system.GetPowerPC().GetMemChecks().GetMemChecks(); - const auto mb_iter = - std::find_if(memory_breakpoints.begin(), memory_breakpoints.end(), - [bp_address](const auto& bp) { return bp.start_address == bp_address; }); - if (mb_iter == memory_breakpoints.end()) + if (!Common::Contains(memory_breakpoints, bp_address, &TMemCheck::start_address)) return; menu->addAction(tr("Show in Memory"), [this, bp_address] { emit ShowMemory(bp_address); }); |
