diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-06-30 23:59:13 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-06-30 23:59:13 +0300 |
commit | 0bb76176be9a6aade2611a10a61cb71065d52d38 (patch) | |
tree | b012a0f2786ced777fa366e1d7deb45b3cea33a0 | |
parent | 70db52b49c6c2764ed48caf4a115031aa9d6b694 (diff) | |
download | manaplus-0bb76176be9a6aade2611a10a61cb71065d52d38.tar.gz manaplus-0bb76176be9a6aade2611a10a61cb71065d52d38.tar.bz2 manaplus-0bb76176be9a6aade2611a10a61cb71065d52d38.tar.xz manaplus-0bb76176be9a6aade2611a10a61cb71065d52d38.zip |
improve size() usage in localplayer.
-rw-r--r-- | src/localplayer.cpp | 9 |
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) |