From 15523a18a556dedf5b27212264a871260608abb6 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sun, 19 Jan 2020 13:00:08 +0100 Subject: [PATCH] Return item name by reference instead of value. --- src/Library/Items/Item.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Library/Items/Item.hpp b/src/Library/Items/Item.hpp index 95c88da..d141126 100644 --- a/src/Library/Items/Item.hpp +++ b/src/Library/Items/Item.hpp @@ -19,7 +19,7 @@ namespace CreatureLib::Library { Item(std::string name, ItemCategory category, BattleItemCategory battleCategory, int32_t price, std::unordered_set flags); - inline const std::string GetName() const { return _name; } + inline const std::string& GetName() const { return _name; } inline ItemCategory GetCategory() const { return _category; } inline BattleItemCategory GetBattleCategory() const { return _battleCategory; } inline const int32_t GetPrice() const { return _price; }