From 88a8a28cc6a2a7b4dd7ba1f0c788f28ed48ec365 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 17 Apr 2020 20:53:33 +0200 Subject: [PATCH] Pass item constructor flags by reference. --- src/Library/Items/Item.cpp | 2 +- src/Library/Items/Item.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Library/Items/Item.cpp b/src/Library/Items/Item.cpp index f8786eb..55764cf 100644 --- a/src/Library/Items/Item.cpp +++ b/src/Library/Items/Item.cpp @@ -10,5 +10,5 @@ bool CreatureLib::Library::Item::HasFlag(uint32_t flag) const noexcept { CreatureLib::Library::Item::Item(const Arbutils::CaseInsensitiveConstString& name, CreatureLib::Library::ItemCategory category, CreatureLib::Library::BattleItemCategory battleCategory, int32_t price, - std::unordered_set flags) + const std::unordered_set& flags) : _name(name), _category(category), _battleCategory(battleCategory), _price(price), _flags(flags) {} diff --git a/src/Library/Items/Item.hpp b/src/Library/Items/Item.hpp index 54166cc..42ae54a 100644 --- a/src/Library/Items/Item.hpp +++ b/src/Library/Items/Item.hpp @@ -18,7 +18,7 @@ namespace CreatureLib::Library { public: Item(const Arbutils::CaseInsensitiveConstString& name, ItemCategory category, BattleItemCategory battleCategory, - int32_t price, std::unordered_set flags); + int32_t price, const std::unordered_set& flags); inline const Arbutils::CaseInsensitiveConstString& GetName() const noexcept { return _name; } inline ItemCategory GetCategory() const noexcept { return _category; }