From b3f70d8d46199524edc590269a73c262899763c7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 8 Sep 2011 00:07:56 +0300 Subject: Replace most iterator to const_iterator. Some other minor changes. --- src/being.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/being.cpp') diff --git a/src/being.cpp b/src/being.cpp index 5a4bcd737..090e7d10d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2155,20 +2155,20 @@ void Being::recalcSpritesOrder() if (spriteToItems) { - SpriteToItemMap::iterator it; + SpriteToItemMap::const_iterator it; for (it = spriteToItems->begin(); it != spriteToItems->end(); ++it) { int removeSprite = it->first; - std::map &itemReplacer = it->second; + const std::map &itemReplacer = it->second; if (itemReplacer.empty()) { mSpriteHide[removeSprite] = 1; } else { - std::map::iterator repIt + std::map::const_iterator repIt = itemReplacer.find(mSpriteIDs[removeSprite]); if (repIt != itemReplacer.end()) { @@ -2188,7 +2188,7 @@ void Being::recalcSpritesOrder() if (info.mDrawBefore[dir] > 0) { int id2 = mSpriteIDs[info.mDrawBefore[dir]]; - std::map::iterator orderIt = itemSlotRemap.find(id2); + std::map::const_iterator orderIt = itemSlotRemap.find(id2); if (orderIt != itemSlotRemap.end()) { // logger->log("found duplicate (before)"); @@ -2211,7 +2211,7 @@ void Being::recalcSpritesOrder() else if (info.mDrawAfter[dir] > 0) { int id2 = mSpriteIDs[info.mDrawAfter[dir]]; - std::map::iterator orderIt = itemSlotRemap.find(id2); + std::map::const_iterator orderIt = itemSlotRemap.find(id2); if (orderIt != itemSlotRemap.end()) { // logger->log("found duplicate (after)"); @@ -2256,7 +2256,7 @@ void Being::recalcSpritesOrder() int idx1 = -1; // logger->log("item %d, id=%d", slot, id); int reorder = 0; - std::map::iterator orderIt = itemSlotRemap.find(id); + std::map::const_iterator orderIt = itemSlotRemap.find(id); if (orderIt != itemSlotRemap.end()) reorder = orderIt->second; -- cgit v1.2.3-70-g09d2