Get rid of unused iterators in JitCache.

This commit is contained in:
lioncash 2013-01-15 12:00:35 -05:00
parent 7402a89e6e
commit 866cdc5961
1 changed files with 6 additions and 8 deletions

View File

@ -370,29 +370,27 @@ bool JitBlock::ContainsAddress(u32 em_address)
{ {
LinkBlockExits(i); LinkBlockExits(i);
JitBlock &b = blocks[i]; JitBlock &b = blocks[i];
std::map<u32, int>::iterator iter;
pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp; pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp;
// equal_range(b) returns pair<iterator,iterator> representing the range // equal_range(b) returns pair<iterator,iterator> representing the range
// of element with key b // of element with key b
ppp = links_to.equal_range(b.originalAddress); ppp = links_to.equal_range(b.originalAddress);
if (ppp.first == ppp.second) if (ppp.first == ppp.second)
return; return;
for (multimap<u32, int>::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) { for (multimap<u32, int>::iterator iter = ppp.first; iter != ppp.second; ++iter) {
// PanicAlert("Linking block %i to block %i", iter2->second, i); // PanicAlert("Linking block %i to block %i", iter->second, i);
LinkBlockExits(iter2->second); LinkBlockExits(iter->second);
} }
} }
void JitBlockCache::UnlinkBlock(int i) void JitBlockCache::UnlinkBlock(int i)
{ {
JitBlock &b = blocks[i]; JitBlock &b = blocks[i];
std::map<u32, int>::iterator iter;
pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp; pair<multimap<u32, int>::iterator, multimap<u32, int>::iterator> ppp;
ppp = links_to.equal_range(b.originalAddress); ppp = links_to.equal_range(b.originalAddress);
if (ppp.first == ppp.second) if (ppp.first == ppp.second)
return; return;
for (multimap<u32, int>::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) { for (multimap<u32, int>::iterator iter = ppp.first; iter != ppp.second; ++iter) {
JitBlock &sourceBlock = blocks[iter2->second]; JitBlock &sourceBlock = blocks[iter->second];
for (int e = 0; e < 2; e++) for (int e = 0; e < 2; e++)
{ {
if (sourceBlock.exitAddress[e] == b.originalAddress) if (sourceBlock.exitAddress[e] == b.originalAddress)
@ -458,7 +456,7 @@ bool JitBlock::ContainsAddress(u32 em_address)
// !! this works correctly under assumption that any two overlapping blocks end at the same address // !! this works correctly under assumption that any two overlapping blocks end at the same address
if (destroy_block) if (destroy_block)
{ {
std::map<pair<u32,u32>, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1, it; std::map<pair<u32,u32>, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1;
while (it2 != block_map.end() && it2->first.second < pAddr + length) while (it2 != block_map.end() && it2->first.second < pAddr + length)
{ {
#ifdef JIT_UNLIMITED_ICACHE #ifdef JIT_UNLIMITED_ICACHE