diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-14 15:36:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-14 15:36:47 +0300 |
commit | 0abd36c63a6ffd16e998fe1552f822ca351ef2b2 (patch) | |
tree | ef2ee4fd8d9fb0383074ddace03eb76e47f0feb4 /src/resources | |
parent | 2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f (diff) | |
download | manaverse-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.cpp | 4 |
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); |