mail[Wesnoth-commits] r44431 - in /trunk/src: unit.cpp unit.hpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by guillaume . melquiond on July 20, 2010 - 12:46:
Author: silene
Date: Tue Jul 20 12:46:51 2010
New Revision: 44431

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44431&view=rev
Log:
Removed unused function sort_units.

Modified:
    trunk/src/unit.cpp
    trunk/src/unit.hpp

Modified: trunk/src/unit.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.cpp?rev=44431&r1=44430&r2=44431&view=diff
==============================================================================
--- trunk/src/unit.cpp (original)
+++ trunk/src/unit.cpp Tue Jul 20 12:46:51 2010
@@ -64,22 +64,6 @@
         * always valid.
         */
        static std::vector<const unit *> units_with_cache;
-}
-
-static bool compare_unit_values(unit const &a, unit const &b)
-{
-       const int lvla = a.level();
-       const int lvlb = b.level();
-
-       const int xpa = a.max_experience() - a.experience();
-       const int xpb = b.max_experience() - b.experience();
-
-       return lvla > lvlb || (lvla == lvlb && xpa < xpb);
-}
-
-void sort_units(std::vector< unit > &units)
-{
-       std::sort(units.begin(), units.end(), compare_unit_values);
 }
 
 static const unit_type &get_unit_type(const std::string &type_id)

Modified: trunk/src/unit.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=44431&r1=44430&r2=44431&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Tue Jul 20 12:46:51 2010
@@ -466,8 +466,6 @@
        int moves_;
 };
 
-void sort_units(std::vector< unit > &);
-
 /** Returns the number of units of the side @a side_num. */
 int side_units(int side_num);
 




Related Messages


Powered by MHonArc, Updated Tue Jul 20 13:00:13 2010