From f3fe62a0bf9e775b3e6e838f104ab605a2238792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Blot?= Date: Wed, 19 Apr 2017 23:02:07 +0200 Subject: Fix various copy instead of const ref reported by cppcheck (#5615) * Also remove InventoryList::peekItem unused function * Fix some post increment to preincrement reported by cppcheck --- src/craftdef.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/craftdef.h') diff --git a/src/craftdef.h b/src/craftdef.h index 695ee0c2c..bdd741f7c 100644 --- a/src/craftdef.h +++ b/src/craftdef.h @@ -97,7 +97,7 @@ struct CraftOutput CraftOutput(): item(""), time(0) {} - CraftOutput(std::string item_, float time_): + CraftOutput(const std::string &item_, float time_): item(item_), time(time_) {} std::string dump() const; @@ -124,7 +124,7 @@ struct CraftReplacements CraftReplacements(): pairs() {} - CraftReplacements(std::vector > pairs_): + CraftReplacements(const std::vector > &pairs_): pairs(pairs_) {} std::string dump() const; @@ -359,10 +359,13 @@ public: CraftDefinitionFuel(): recipe(""), hash_inited(false), burntime() {} - CraftDefinitionFuel(std::string recipe_, + CraftDefinitionFuel(const std::string &recipe_, float burntime_, const CraftReplacements &replacements_): - recipe(recipe_), hash_inited(false), burntime(burntime_), replacements(replacements_) + recipe(recipe_), + hash_inited(false), + burntime(burntime_), + replacements(replacements_) {} virtual ~CraftDefinitionFuel(){} -- cgit v1.2.3