Sprucing up some of alloy.

This commit is contained in:
Ben Vanik
2014-07-13 21:15:37 -07:00
parent 48425da8ff
commit 9437d0b564
40 changed files with 246 additions and 228 deletions

View File

@@ -26,9 +26,10 @@ Function::~Function() = default;
int Function::AddBreakpoint(Breakpoint* breakpoint) {
std::lock_guard<std::mutex> guard(lock_);
bool found = false;
for (auto it = breakpoints_.begin(); it != breakpoints_.end(); ++it) {
if (*it == breakpoint) {
for (auto other : breakpoints_) {
if (other == breakpoint) {
found = true;
break;
}
}
if (!found) {
@@ -54,9 +55,8 @@ int Function::RemoveBreakpoint(Breakpoint* breakpoint) {
Breakpoint* Function::FindBreakpoint(uint64_t address) {
std::lock_guard<std::mutex> guard(lock_);
Breakpoint* result = NULL;
for (auto it = breakpoints_.begin(); it != breakpoints_.end(); ++it) {
Breakpoint* breakpoint = *it;
Breakpoint* result = nullptr;
for (auto breakpoint : breakpoints_) {
if (breakpoint->address() == address) {
result = breakpoint;
break;