mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
BreakPoints: Invert if statements where reasonable
Puts the early-exit condition first, unindenting code that doesn't need to be.
This commit is contained in:
parent
3137d4f75f
commit
b4cd11c7c9
@ -62,18 +62,21 @@ void BreakPoints::AddFromStrings(const TBreakPointsStr& bp_strings)
|
||||
|
||||
void BreakPoints::Add(const TBreakPoint& bp)
|
||||
{
|
||||
if (!IsAddressBreakPoint(bp.address))
|
||||
{
|
||||
if (IsAddressBreakPoint(bp.address))
|
||||
return;
|
||||
|
||||
m_breakpoints.push_back(bp);
|
||||
|
||||
if (g_jit)
|
||||
g_jit->GetBlockCache()->InvalidateICache(bp.address, 4, true);
|
||||
}
|
||||
}
|
||||
|
||||
void BreakPoints::Add(u32 address, bool temp)
|
||||
{
|
||||
if (!IsAddressBreakPoint(address)) // only add new addresses
|
||||
{
|
||||
// Only add new addresses
|
||||
if (IsAddressBreakPoint(address))
|
||||
return;
|
||||
|
||||
TBreakPoint bp; // breakpoint settings
|
||||
bp.is_enabled = true;
|
||||
bp.is_temporary = temp;
|
||||
@ -83,7 +86,6 @@ void BreakPoints::Add(u32 address, bool temp)
|
||||
|
||||
if (g_jit)
|
||||
g_jit->GetBlockCache()->InvalidateICache(address, 4, true);
|
||||
}
|
||||
}
|
||||
|
||||
void BreakPoints::Remove(u32 address)
|
||||
@ -170,8 +172,9 @@ void MemChecks::AddFromStrings(const TMemChecksStr& mc_strings)
|
||||
|
||||
void MemChecks::Add(const TMemCheck& memory_check)
|
||||
{
|
||||
if (GetMemCheck(memory_check.start_address) == nullptr)
|
||||
{
|
||||
if (GetMemCheck(memory_check.start_address) != nullptr)
|
||||
return;
|
||||
|
||||
bool had_any = HasAny();
|
||||
Core::RunAsCPUThread([&] {
|
||||
m_mem_checks.push_back(memory_check);
|
||||
@ -181,7 +184,6 @@ void MemChecks::Add(const TMemCheck& memory_check)
|
||||
g_jit->ClearCache();
|
||||
PowerPC::DBATUpdated();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void MemChecks::Remove(u32 address)
|
||||
@ -284,22 +286,23 @@ void Watches::AddFromStrings(const TWatchesStr& watch_strings)
|
||||
|
||||
void Watches::Add(const TWatch& watch)
|
||||
{
|
||||
if (!IsAddressWatch(watch.address))
|
||||
{
|
||||
if (IsAddressWatch(watch.address))
|
||||
return;
|
||||
|
||||
m_watches.push_back(watch);
|
||||
}
|
||||
}
|
||||
|
||||
void Watches::Add(u32 address)
|
||||
{
|
||||
if (!IsAddressWatch(address)) // only add new addresses
|
||||
{
|
||||
// Only add new addresses
|
||||
if (IsAddressWatch(address))
|
||||
return;
|
||||
|
||||
TWatch watch; // watch settings
|
||||
watch.is_enabled = true;
|
||||
watch.address = address;
|
||||
|
||||
m_watches.push_back(watch);
|
||||
}
|
||||
}
|
||||
|
||||
void Watches::Update(int count, u32 address)
|
||||
|
Loading…
x
Reference in New Issue
Block a user