From 1c8cb43994aa8ec524f64295ce16a1b361a03dab Mon Sep 17 00:00:00 2001 From: Eduardo Dantas Date: Wed, 13 Sep 2023 22:56:17 -0300 Subject: [PATCH] fix: pass itemvector to const reference --- src/game/game.cpp | 2 +- src/game/game.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/game.cpp b/src/game/game.cpp index 7cffc924a0b..7ddfc190bc7 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -9239,7 +9239,7 @@ void Game::removeGuild(uint32_t guildId) { guilds.erase(guildId); } -void Game::internalRemoveItems(const std::vector> itemVector, uint32_t amount, bool stackable) { +void Game::internalRemoveItems(const std::vector>& itemVector, uint32_t amount, bool stackable) { if (stackable) { for (std::shared_ptr item : itemVector) { if (item->getItemCount() > amount) { diff --git a/src/game/game.hpp b/src/game/game.hpp index cce1c21e5a3..427d51d8d16 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -498,7 +498,7 @@ class Game { phmap::flat_hash_map, std::weak_ptr> browseFields; - void internalRemoveItems(const std::vector> itemVector, uint32_t amount, bool stackable); + void internalRemoveItems(const std::vector>& itemVector, uint32_t amount, bool stackable); std::shared_ptr getBedBySleeper(uint32_t guid) const; void setBedSleeper(std::shared_ptr bed, uint32_t guid);