summaryrefslogtreecommitdiff
path: root/src/craftdef.h
diff options
context:
space:
mode:
authorLoïc Blot <nerzhul@users.noreply.github.com>2017-04-19 23:02:07 +0200
committerGitHub <noreply@github.com>2017-04-19 23:02:07 +0200
commitf3fe62a0bf9e775b3e6e838f104ab605a2238792 (patch)
tree1335fc9752d54924dd3a8f22e70d555fb54945c8 /src/craftdef.h
parentcfe0291b131630a7400fdcf46b720bd70d8d0fa0 (diff)
downloadminetest-f3fe62a0bf9e775b3e6e838f104ab605a2238792.tar.gz
minetest-f3fe62a0bf9e775b3e6e838f104ab605a2238792.tar.bz2
minetest-f3fe62a0bf9e775b3e6e838f104ab605a2238792.zip
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
Diffstat (limited to 'src/craftdef.h')
-rw-r--r--src/craftdef.h11
1 files changed, 7 insertions, 4 deletions
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<std::pair<std::string, std::string> > pairs_):
+ CraftReplacements(const std::vector<std::pair<std::string, std::string> > &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(){}