Pass item constructor flags by reference.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-17 20:53:33 +02:00
parent 317f616be2
commit 88a8a28cc6
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
2 changed files with 2 additions and 2 deletions

View File

@ -10,5 +10,5 @@ bool CreatureLib::Library::Item::HasFlag(uint32_t flag) const noexcept {
CreatureLib::Library::Item::Item(const Arbutils::CaseInsensitiveConstString& name, CreatureLib::Library::Item::Item(const Arbutils::CaseInsensitiveConstString& name,
CreatureLib::Library::ItemCategory category, CreatureLib::Library::ItemCategory category,
CreatureLib::Library::BattleItemCategory battleCategory, int32_t price, CreatureLib::Library::BattleItemCategory battleCategory, int32_t price,
std::unordered_set<uint32_t> flags) const std::unordered_set<uint32_t>& flags)
: _name(name), _category(category), _battleCategory(battleCategory), _price(price), _flags(flags) {} : _name(name), _category(category), _battleCategory(battleCategory), _price(price), _flags(flags) {}

View File

@ -18,7 +18,7 @@ namespace CreatureLib::Library {
public: public:
Item(const Arbutils::CaseInsensitiveConstString& name, ItemCategory category, BattleItemCategory battleCategory, Item(const Arbutils::CaseInsensitiveConstString& name, ItemCategory category, BattleItemCategory battleCategory,
int32_t price, std::unordered_set<uint32_t> flags); int32_t price, const std::unordered_set<uint32_t>& flags);
inline const Arbutils::CaseInsensitiveConstString& GetName() const noexcept { return _name; } inline const Arbutils::CaseInsensitiveConstString& GetName() const noexcept { return _name; }
inline ItemCategory GetCategory() const noexcept { return _category; } inline ItemCategory GetCategory() const noexcept { return _category; }