summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-07 21:01:35 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-07 21:38:22 +0300
commita9732d3ad6115ad7d590e819631dfbd764d13d3e (patch)
treec62984bf527305f275a521e227d785df769c1351
parentb43854b65e0c8bdbc37db2a0b6e2e86ebf11e7f7 (diff)
downloadplus-a9732d3ad6115ad7d590e819631dfbd764d13d3e.tar.gz
plus-a9732d3ad6115ad7d590e819631dfbd764d13d3e.tar.bz2
plus-a9732d3ad6115ad7d590e819631dfbd764d13d3e.tar.xz
plus-a9732d3ad6115ad7d590e819631dfbd764d13d3e.zip
remove useless checks.
-rw-r--r--src/gui/shopwindow.cpp2
-rw-r--r--src/gui/socialwindow.cpp2
-rw-r--r--src/gui/widgets/guitable.cpp13
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/net/ea/partyhandler.cpp2
-rw-r--r--src/net/eathena/beinghandler.cpp7
-rw-r--r--src/net/eathena/charserverhandler.cpp2
-rw-r--r--src/net/tmwa/beinghandler.cpp7
-rw-r--r--src/net/tmwa/charserverhandler.cpp2
-rw-r--r--src/soundmanager.cpp7
10 files changed, 17 insertions, 29 deletions
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index 0119bc68b..0ed8065ae 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -817,7 +817,7 @@ bool ShopWindow::findShopItem(const ShopItem *const shopItem, const int mode)
if (!item)
continue;
- if (item && item->getId() == shopItem->getId()
+ if (item->getId() == shopItem->getId()
&& item->getPrice() == shopItem->getPrice()
&& item->getQuantity() >= shopItem->getQuantity())
{
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp
index 10eb2596e..3c65358ea 100644
--- a/src/gui/socialwindow.cpp
+++ b/src/gui/socialwindow.cpp
@@ -876,7 +876,7 @@ public:
if (!ava)
break;
- if (ava && ava->getX() == x && ava->getY() == y)
+ if (ava->getX() == x && ava->getY() == y)
{
delete ava;
avatars->erase(i);
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 16604d760..ec23fda38 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -588,16 +588,13 @@ void GuiTable::_setFocusHandler(gcn::FocusHandler* focusHandler)
gcn::Widget::_setFocusHandler(focusHandler);
- if (mModel)
+ for (int r = 0; r < mModel->getRows(); ++r)
{
- for (int r = 0; r < mModel->getRows(); ++r)
+ for (int c = 0; c < mModel->getColumns(); ++c)
{
- for (int c = 0; c < mModel->getColumns(); ++c)
- {
- gcn::Widget *const w = mModel->getElementAt(r, c);
- if (w)
- w->_setFocusHandler(focusHandler);
- }
+ gcn::Widget *const w = mModel->getElementAt(r, c);
+ if (w)
+ w->_setFocusHandler(focusHandler);
}
}
}
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index 82f7b82e4..a805aa5cc 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -379,7 +379,7 @@ void TabbedArea::widgetResized(const gcn::Event &event A_UNUSED)
const gcn::Rectangle rect = w->getDimension();
if (rect.height != 0 && rect.height > height + 2)
{
- if (scr && scr->getVerticalScrollAmount()
+ if (scr->getVerticalScrollAmount()
>= scr->getVerticalMaxScroll() - 2
&& scr->getVerticalScrollAmount()
<= scr->getVerticalMaxScroll() + 2)
diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp
index 6172fce34..92cf48a2d 100644
--- a/src/net/ea/partyhandler.cpp
+++ b/src/net/ea/partyhandler.cpp
@@ -194,7 +194,7 @@ void PartyHandler::processPartyInvited(Net::MessageIn &msg)
{
if ((being = actorSpriteManager->findBeing(id)))
{
- if (being && being->getType() == Being::PLAYER)
+ if (being->getType() == Being::PLAYER)
nick = being->getName();
}
}
diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp
index f62d4d9db..6fb7ee087 100644
--- a/src/net/eathena/beinghandler.cpp
+++ b/src/net/eathena/beinghandler.cpp
@@ -377,11 +377,8 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
default:
logger->log("QQQ3 CHANGE_LOOKS: unsupported type: "
"%d, id: %d", type, id);
- if (dstBeing)
- {
- logger->log("ID: " + toString(dstBeing->getId()));
- logger->log("name: " + toString(dstBeing->getName()));
- }
+ logger->log("ID: " + toString(dstBeing->getId()));
+ logger->log("name: " + toString(dstBeing->getName()));
break;
}
}
diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp
index 2fee39a03..ca4275ebe 100644
--- a/src/net/eathena/charserverhandler.cpp
+++ b/src/net/eathena/charserverhandler.cpp
@@ -286,7 +286,7 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
Net::Character *const character = new Net::Character;
readPlayerData(msg, character, false);
mCharacters.push_back(character);
- if (character && character->dummy)
+ if (character->dummy)
{
logger->log("CharServer: Player: %s (%d)",
character->dummy->getName().c_str(), character->slot);
diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp
index a7300f601..28f7fc999 100644
--- a/src/net/tmwa/beinghandler.cpp
+++ b/src/net/tmwa/beinghandler.cpp
@@ -377,11 +377,8 @@ void BeingHandler::processBeingChangeLook(Net::MessageIn &msg,
default:
logger->log("QQQ3 CHANGE_LOOKS: unsupported type: "
"%d, id: %d", type, id);
- if (dstBeing)
- {
- logger->log("ID: " + toString(dstBeing->getId()));
- logger->log("name: " + toString(dstBeing->getName()));
- }
+ logger->log("ID: " + toString(dstBeing->getId()));
+ logger->log("name: " + toString(dstBeing->getName()));
break;
}
}
diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp
index 0b449bff8..d2f727af9 100644
--- a/src/net/tmwa/charserverhandler.cpp
+++ b/src/net/tmwa/charserverhandler.cpp
@@ -330,7 +330,7 @@ void CharServerHandler::processCharLogin(Net::MessageIn &msg)
Net::Character *const character = new Net::Character;
readPlayerData(msg, character, version);
mCharacters.push_back(character);
- if (character && character->dummy)
+ if (character->dummy)
{
logger->log("CharServer: Player: %s (%d)",
character->dummy->getName().c_str(), character->slot);
diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp
index 6eca843cd..83f9c0a72 100644
--- a/src/soundmanager.cpp
+++ b/src/soundmanager.cpp
@@ -415,11 +415,8 @@ void SoundManager::haltMusic()
return;
Mix_HaltMusic();
- if (mMusic)
- {
- mMusic->decRef();
- mMusic = nullptr;
- }
+ mMusic->decRef();
+ mMusic = nullptr;
mCurrentMusicFile.clear();
}