Skip to content

Commit

Permalink
Fix incorrect usage of const ref shared ptr in container class
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro authored Jan 1, 2025
1 parent b9f7dfa commit c6278fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void Container::onUpdateItem(int slot, const ItemPtr& item)
return;
}

const auto& oldItem = m_items[slot];
const auto oldItem = m_items[slot];
m_items[slot] = item;
item->setPosition(getSlotPosition(slot));

Expand All @@ -106,7 +106,7 @@ void Container::onRemoveItem(int slot, const ItemPtr& lastItem)
return;
}

const auto& item = m_items[slot];
const auto item = m_items[slot];
m_items.erase(m_items.begin() + slot);

if (lastItem) {
Expand All @@ -126,4 +126,4 @@ void Container::updateItemsPositions()
{
for (int slot = 0; slot < static_cast<int>(m_items.size()); ++slot)
m_items[slot]->setPosition(getSlotPosition(slot));
}
}

0 comments on commit c6278fa

Please sign in to comment.