From 7e66a4606bb15d98197f71245fe191d03152ee5f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 8 Feb 2016 23:02:06 +0300 Subject: Improve some empty string checks. --- src/actormanager.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/actormanager.cpp') diff --git a/src/actormanager.cpp b/src/actormanager.cpp index c41f97c71..6b27e3205 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -1587,7 +1587,7 @@ void ActorManager::getPlayerNames(StringVect &names, if ((being->getType() == ActorType::Player || (being->getType() == ActorType::Npc && npcNames == NpcNames_true)) && - being->getName() != "") + !being->getName().empty()) { names.push_back(being->getName()); } @@ -1610,7 +1610,7 @@ void ActorManager::getMobNames(StringVect &names) const } const Being *const being = static_cast(*it); - if (being->getType() == ActorType::Monster && being->getName() != "") + if (being->getType() == ActorType::Monster && !being->getName().empty()) names.push_back(being->getName()); } } @@ -1630,7 +1630,7 @@ void ActorManager::updatePlayerNames() const Being *const being = static_cast(*it); being->setGoodStatus(-1); - if (being->getType() == ActorType::Player && being->getName() != "") + if (being->getType() == ActorType::Player && !being->getName().empty()) being->updateName(); } } @@ -1649,7 +1649,7 @@ void ActorManager::updatePlayerColors() const } Being *const being = static_cast(*it); - if (being->getType() == ActorType::Player && being->getName() != "") + if (being->getType() == ActorType::Player && !being->getName().empty()) being->updateColors(); } } @@ -1668,7 +1668,7 @@ void ActorManager::updatePlayerGuild() const } Being *const being = static_cast(*it); - if (being->getType() == ActorType::Player && being->getName() != "") + if (being->getType() == ActorType::Player && !being->getName().empty()) being->updateGuild(); } } -- cgit v1.2.3-60-g2f50