Author: shadowmaster
Date: Mon Jun 9 00:13:13 2008
New Revision: 27055
URL: http://svn.gna.org/viewcvs/wesnoth?rev=27055&view=rev
Log:
* Pass a string by const reference rather than variable value.
Modified:
trunk/src/unit_types.cpp
trunk/src/unit_types.hpp
Modified: trunk/src/unit_types.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.cpp?rev=27055&r1=27054&r2=27055&view=diff
==============================================================================
--- trunk/src/unit_types.cpp (original)
+++ trunk/src/unit_types.cpp Mon Jun 9 00:13:13 2008
@@ -900,7 +900,7 @@
}
// Allow storing "advances from" info for convenience in Help.
-void unit_type::add_advancesfrom(std::string unit_id)
+void unit_type::add_advancesfrom(const std::string& unit_id)
{
if (find(advances_from_.begin(), advances_from_.end(), unit_id) ==
advances_from_.end())
advances_from_.push_back(unit_id);
Modified: trunk/src/unit_types.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit_types.hpp?rev=27055&r1=27054&r2=27055&view=diff
==============================================================================
--- trunk/src/unit_types.hpp (original)
+++ trunk/src/unit_types.hpp Mon Jun 9 00:13:13 2008
@@ -172,7 +172,7 @@
void add_advancement(const unit_type &advance_to,int experience);
/** Adds units that this unit advances from, for help file purposes. */
- void add_advancesfrom(std::string unit_id);
+ void add_advancesfrom(const std::string& unit_id);
const unit_type& get_gender_unit_type(unit_race::GENDER gender) const;
const unit_type& get_variation(const std::string& name) const;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits