Skip to content

Commit

Permalink
fix: pass itemvector to const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
dudantas committed Sep 14, 2023
1 parent b8be979 commit 1c8cb43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9239,7 +9239,7 @@ void Game::removeGuild(uint32_t guildId) {
guilds.erase(guildId);
}

void Game::internalRemoveItems(const std::vector<std::shared_ptr<Item>> itemVector, uint32_t amount, bool stackable) {
void Game::internalRemoveItems(const std::vector<std::shared_ptr<Item>>& itemVector, uint32_t amount, bool stackable) {
if (stackable) {
for (std::shared_ptr<Item> item : itemVector) {
if (item->getItemCount() > amount) {
Expand Down
2 changes: 1 addition & 1 deletion src/game/game.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class Game {

phmap::flat_hash_map<std::shared_ptr<Tile>, std::weak_ptr<Container>> browseFields;

void internalRemoveItems(const std::vector<std::shared_ptr<Item>> itemVector, uint32_t amount, bool stackable);
void internalRemoveItems(const std::vector<std::shared_ptr<Item>>& itemVector, uint32_t amount, bool stackable);

std::shared_ptr<BedItem> getBedBySleeper(uint32_t guid) const;
void setBedSleeper(std::shared_ptr<BedItem> bed, uint32_t guid);
Expand Down

0 comments on commit 1c8cb43

Please sign in to comment.