summaryrefslogtreecommitdiff
path: root/src/gui/widgets/shopitems.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/shopitems.cpp')
-rw-r--r--src/gui/widgets/shopitems.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/gui/widgets/shopitems.cpp b/src/gui/widgets/shopitems.cpp
index 91829131..031416e0 100644
--- a/src/gui/widgets/shopitems.cpp
+++ b/src/gui/widgets/shopitems.cpp
@@ -60,7 +60,7 @@ void ShopItems::addItem(int inventoryIndex, int id, int quantity, int price)
if (item)
{
- item->addDuplicate (inventoryIndex, quantity);
+ item->addDuplicate(inventoryIndex, quantity);
}
else
{
@@ -87,15 +87,11 @@ void ShopItems::clear()
ShopItem *ShopItems::findItem(int id)
{
- ShopItem *item;
-
- std::vector<ShopItem*>::iterator it;
- for (it = mShopItems.begin(); it != mShopItems.end(); it++)
+ for (auto shopItem : mShopItems)
{
- item = *(it);
- if (item->getId() == id)
+ if (shopItem->getId() == id)
{
- return item;
+ return shopItem;
}
}