summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-08 00:07:56 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-08 00:07:56 +0300
commitb3f70d8d46199524edc590269a73c262899763c7 (patch)
treeaf8e20371f2cc825c0b2dbe0c0e5c392a926c46d /src/being.cpp
parent3f84fc198131ff706e18c56f612e38ff147b0005 (diff)
downloadplus-b3f70d8d46199524edc590269a73c262899763c7.tar.gz
plus-b3f70d8d46199524edc590269a73c262899763c7.tar.bz2
plus-b3f70d8d46199524edc590269a73c262899763c7.tar.xz
plus-b3f70d8d46199524edc590269a73c262899763c7.zip
Replace most iterator to const_iterator.
Some other minor changes.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp12
1 files changed, 6 insertions, 6 deletions
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<int, int> &itemReplacer = it->second;
+ const std::map<int, int> &itemReplacer = it->second;
if (itemReplacer.empty())
{
mSpriteHide[removeSprite] = 1;
}
else
{
- std::map<int, int>::iterator repIt
+ std::map<int, int>::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<int, int>::iterator orderIt = itemSlotRemap.find(id2);
+ std::map<int, int>::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<int, int>::iterator orderIt = itemSlotRemap.find(id2);
+ std::map<int, int>::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<int, int>::iterator orderIt = itemSlotRemap.find(id);
+ std::map<int, int>::const_iterator orderIt = itemSlotRemap.find(id);
if (orderIt != itemSlotRemap.end())
reorder = orderIt->second;