mail[Wesnoth-commits] r44244 - /trunk/src/game.cpp


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

Header


Content

Posted by guillaume . melquiond on July 17, 2010 - 15:06:
Author: silene
Date: Sat Jul 17 15:06:35 2010
New Revision: 44244

URL: http://svn.gna.org/viewcvs/wesnoth?rev=44244&view=rev
Log:
Avoided costly roundtrip through strings.

Modified:
    trunk/src/game.cpp

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=44244&r1=44243&r2=44244&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Sat Jul 17 15:06:35 2010
@@ -1033,8 +1033,8 @@
                        if (side["controller"] != "human") continue;
                        foreach (config &unit, side.child_range("unit"))
                        {
-                               unit["goto_x"] = "-999";
-                               unit["goto_y"] = "-999";
+                               unit["goto_x"] = -999;
+                               unit["goto_y"] = -999;
                        }
                }
        }
@@ -1053,13 +1053,10 @@
 
 }
 
-void game_controller::mark_completed_campaigns(std::vector<config>& 
campaigns) {
-       foreach(config &campaign, campaigns) {
-               if(preferences::is_campaign_completed(campaign["id"])) {
-                       campaign["completed"] = "true";
-               } else {
-                       campaign["completed"] = "false";
-               }
+void game_controller::mark_completed_campaigns(std::vector<config> 
&campaigns)
+{
+       foreach (config &campaign, campaigns) {
+               campaign["completed"] = 
preferences::is_campaign_completed(campaign["id"]);
        }
 }
 




Related Messages


Powered by MHonArc, Updated Sat Jul 17 15:20:14 2010