From 665e33246a82838dc8893e6b84a576de803a3195 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 15 Apr 2013 22:21:48 +0300 Subject: improve iteminfo class. --- src/resources/iteminfo.cpp | 6 +++--- src/resources/iteminfo.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/resources') diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 92df520ea..4ec5d81f9 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -84,7 +84,7 @@ const std::string &ItemInfo::getSprite(const Gender gender, } else { - static const std::string empty(""); + static const std::string empty; std::map::const_iterator i = mAnimationFiles.find(static_cast(gender) + race * 4); @@ -97,7 +97,7 @@ const std::string &ItemInfo::getSprite(const Gender gender, } } -void ItemInfo::setAttackAction(std::string attackAction) +void ItemInfo::setAttackAction(const std::string &attackAction) { if (attackAction.empty()) mAttackAction = SpriteAction::ATTACK; // (Equal to unarmed animation) @@ -148,7 +148,7 @@ std::map *ItemInfo::addReplaceSprite(const int sprite, return &it->second; } -void ItemInfo::setColorsList(std::string name) +void ItemInfo::setColorsList(const std::string &name) { if (name.empty()) { diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 380624b7b..e5b6f96b8 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -178,7 +178,7 @@ class ItemInfo final const std::string &getSprite(const Gender gender, const int race) const A_WARN_UNUSED; - void setAttackAction(std::string attackAction); + void setAttackAction(const std::string &attackAction); // Handlers for seting and getting the string // used for particles when attacking @@ -275,7 +275,7 @@ class ItemInfo final std::string getDyeColorsString(const int color) const A_WARN_UNUSED; - void setColorsList(std::string name); + void setColorsList(const std::string &name); bool isHaveColors() const A_WARN_UNUSED { return !mColorList.empty(); } -- cgit v1.2.3-70-g09d2