From 866cdc5961590e3a17cf3d6f753fb96c6b66dc9e Mon Sep 17 00:00:00 2001 From: lioncash Date: Tue, 15 Jan 2013 12:00:35 -0500 Subject: [PATCH] Get rid of unused iterators in JitCache. --- .../Core/Core/Src/PowerPC/JitCommon/JitCache.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp index 496ddebf7a..a8cc0e9b46 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitCache.cpp @@ -370,29 +370,27 @@ bool JitBlock::ContainsAddress(u32 em_address) { LinkBlockExits(i); JitBlock &b = blocks[i]; - std::map::iterator iter; pair::iterator, multimap::iterator> ppp; // equal_range(b) returns pair representing the range // of element with key b ppp = links_to.equal_range(b.originalAddress); if (ppp.first == ppp.second) return; - for (multimap::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) { - // PanicAlert("Linking block %i to block %i", iter2->second, i); - LinkBlockExits(iter2->second); + for (multimap::iterator iter = ppp.first; iter != ppp.second; ++iter) { + // PanicAlert("Linking block %i to block %i", iter->second, i); + LinkBlockExits(iter->second); } } void JitBlockCache::UnlinkBlock(int i) { JitBlock &b = blocks[i]; - std::map::iterator iter; pair::iterator, multimap::iterator> ppp; ppp = links_to.equal_range(b.originalAddress); if (ppp.first == ppp.second) return; - for (multimap::iterator iter2 = ppp.first; iter2 != ppp.second; ++iter2) { - JitBlock &sourceBlock = blocks[iter2->second]; + for (multimap::iterator iter = ppp.first; iter != ppp.second; ++iter) { + JitBlock &sourceBlock = blocks[iter->second]; for (int e = 0; e < 2; e++) { 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 if (destroy_block) { - std::map, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1, it; + std::map, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1; while (it2 != block_map.end() && it2->first.second < pAddr + length) { #ifdef JIT_UNLIMITED_ICACHE