summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2017-01-11 16:34:38 -0500
committerLioncash <mathew1800@gmail.com>2017-01-11 16:37:31 -0500
commitb760479f7788c19b6ab63ed7aa31f353e3d90897 (patch)
tree0f629f843a2e22bdb67009182dc7f4715c9b16b8
parente97953130d50f36c017db71271ddda8c6c055071 (diff)
BreakPoints: Use std::any_of where applicable
-rw-r--r--Source/Core/Core/PowerPC/BreakPoints.cpp23
1 files 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 <algorithm>
#include <sstream>
#include <string>
#include <vector>
@@ -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