summaryrefslogtreecommitdiff
path: root/src/resources/iteminfo.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-14 15:36:47 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-14 15:36:47 +0300
commit0abd36c63a6ffd16e998fe1552f822ca351ef2b2 (patch)
treeef2ee4fd8d9fb0383074ddace03eb76e47f0feb4 /src/resources/iteminfo.cpp
parent2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f (diff)
downloadmv-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.tar.gz
mv-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.tar.bz2
mv-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.tar.xz
mv-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.zip
Replace some size() calls to empty().
Diffstat (limited to 'src/resources/iteminfo.cpp')
-rw-r--r--src/resources/iteminfo.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp
index a5b81081c..5b07724a1 100644
--- a/src/resources/iteminfo.cpp
+++ b/src/resources/iteminfo.cpp
@@ -139,7 +139,7 @@ const std::string &ItemInfo::getSound(EquipmentSoundEvent event) const
if (i == mSounds.end())
return empty;
- return i->second.size() > 0 ? i->second[rand() % i->second.size()] : empty;
+ return (!i->second.empty()) ? i->second[rand() % i->second.size()] : empty;
}
std::map<int, int> *ItemInfo::addReplaceSprite(int sprite, int direction)
@@ -222,7 +222,7 @@ const std::string ItemInfo::replaceColors(std::string str,
}
str = replaceAll(str, "%color%", name);
- if (name.size() > 0)
+ if (!name.empty())
name[0] = static_cast<char>(toupper(name[0]));
return replaceAll(str, "%Color%", name);