From b760479f7788c19b6ab63ed7aa31f353e3d90897 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 11 Jan 2017 16:34:38 -0500 Subject: [PATCH] BreakPoints: Use std::any_of where applicable --- Source/Core/Core/PowerPC/BreakPoints.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Source/Core/Core/PowerPC/BreakPoints.cpp b/Source/Core/Core/PowerPC/BreakPoints.cpp index c3cb390836..4ef86f95a7 100644 --- a/Source/Core/Core/PowerPC/BreakPoints.cpp +++ b/Source/Core/Core/PowerPC/BreakPoints.cpp @@ -4,6 +4,7 @@ #include "Core/PowerPC/BreakPoints.h" +#include #include #include #include @@ -15,20 +16,15 @@ bool BreakPoints::IsAddressBreakPoint(u32 address) const { - for (const TBreakPoint& bp : m_breakpoints) - if (bp.address == address) - return true; - - return false; + return std::any_of(m_breakpoints.begin(), m_breakpoints.end(), + [address](const auto& bp) { return bp.address == address; }); } bool BreakPoints::IsTempBreakPoint(u32 address) const { - for (const TBreakPoint& bp : m_breakpoints) - if (bp.address == address && bp.is_temporary) - return true; - - return false; + return std::any_of(m_breakpoints.begin(), m_breakpoints.end(), [address](const auto& bp) { + return bp.address == address && bp.is_temporary; + }); } BreakPoints::TBreakPointsStr BreakPoints::GetStrings() const @@ -233,11 +229,8 @@ bool TMemCheck::Action(DebugInterface* debug_interface, u32 value, u32 addr, boo bool Watches::IsAddressWatch(u32 address) const { - for (const TWatch& watch : m_watches) - if (watch.address == address) - return true; - - return false; + return std::any_of(m_watches.begin(), m_watches.end(), + [address](const auto& watch) { return watch.address == address; }); } Watches::TWatchesStr Watches::GetStrings() const