summaryrefslogtreecommitdiff
path: root/src/resources
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
parent2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f (diff)
downloadmanaverse-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.tar.gz
manaverse-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.tar.bz2
manaverse-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.tar.xz
manaverse-0abd36c63a6ffd16e998fe1552f822ca351ef2b2.zip
Replace some size() calls to empty().
Diffstat (limited to 'src/resources')
-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);