diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/gui/models/shopitems.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gui/models/shopitems.cpp')
-rw-r--r-- | src/gui/models/shopitems.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/models/shopitems.cpp b/src/gui/models/shopitems.cpp index 94bba3be4..a5c05388b 100644 --- a/src/gui/models/shopitems.cpp +++ b/src/gui/models/shopitems.cpp @@ -46,7 +46,7 @@ ShopItems::~ShopItems() std::string ShopItems::getElementAt(int i) { if (i < 0 || CAST_U32(i) - >= CAST_U32(mShopItems.size()) || !mShopItems.at(i)) + >= CAST_U32(mShopItems.size()) || (mShopItems.at(i) == nullptr)) { return ""; } @@ -79,7 +79,7 @@ ShopItem *ShopItems::addItemNoDup(const int id, const int price) { ShopItem *item = findItem(id, color); - if (!item) + if (item == nullptr) { item = new ShopItem(-1, id, @@ -105,7 +105,7 @@ ShopItem *ShopItems::addItem2(const int inventoryIndex, if (mMergeDuplicates) item = findItem(id, color); - if (item) + if (item != nullptr) { item->addDuplicate(inventoryIndex, quantity); } @@ -199,7 +199,7 @@ void ShopItems::updateList() FOR_EACH (std::vector<ShopItem*>::iterator, it, mAllShopItems) { ShopItem *const item = *it; - if (item && item->isVisible()) + if ((item != nullptr) && item->isVisible()) mShopItems.push_back(item); } } |