summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-30 23:59:13 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-30 23:59:13 +0300
commit0bb76176be9a6aade2611a10a61cb71065d52d38 (patch)
treeb012a0f2786ced777fa366e1d7deb45b3cea33a0 /src
parent70db52b49c6c2764ed48caf4a115031aa9d6b694 (diff)
downloadplus-0bb76176be9a6aade2611a10a61cb71065d52d38.tar.gz
plus-0bb76176be9a6aade2611a10a61cb71065d52d38.tar.bz2
plus-0bb76176be9a6aade2611a10a61cb71065d52d38.tar.xz
plus-0bb76176be9a6aade2611a10a61cb71065d52d38.zip
improve size() usage in localplayer.
Diffstat (limited to 'src')
-rw-r--r--src/localplayer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index c69e5b58a..4f1aa1f10 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -1553,8 +1553,8 @@ void LocalPlayer::handleStatusEffect(StatusEffect *const effect,
{
// replace sprite or append
bool found = false;
-
- for (unsigned int i = 0; i < mStatusEffectIcons.size(); i++)
+ const unsigned int sz = mStatusEffectIcons.size();
+ for (unsigned int i = 0; i < sz; i++)
{
if (mStatusEffectIcons[i] == effectId)
{
@@ -1767,9 +1767,10 @@ void LocalPlayer::moveToTarget(int dist)
mTarget->getTileX(), mTarget->getTileY(), getWalkMask(), 0);
}
- if (debugPath.size() < static_cast<unsigned>(dist))
+ const unsigned int sz = debugPath.size();
+ if (sz < static_cast<unsigned int>(dist))
return;
- limit = static_cast<int>(debugPath.size()) - dist;
+ limit = static_cast<int>(sz) - dist;
gotPos = true;
}
else if (mNavigateX || mNavigateY)