mail[Wesnoth-commits] r43360 - /trunk/src/ai/configuration.cpp


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

Header


Content

Posted by guillaume . melquiond on June 12, 2010 - 20:57:
Author: silene
Date: Sat Jun 12 20:57:40 2010
New Revision: 43360

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

Modified:
    trunk/src/ai/configuration.cpp

Modified: trunk/src/ai/configuration.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/ai/configuration.cpp?rev=43360&r1=43359&r2=43360&view=diff
==============================================================================
--- trunk/src/ai/configuration.cpp (original)
+++ trunk/src/ai/configuration.cpp Sat Jun 12 20:57:40 2010
@@ -27,7 +27,6 @@
 #include "../serialization/preprocessor.hpp"
 #include "../team.hpp"
 
-#include <boost/lexical_cast.hpp>
 #include <vector>
 
 namespace ai {
@@ -266,7 +265,7 @@
        int version = 10600;
        foreach (const config &aiparam, cfg.child_range("ai")) {
                if (aiparam.has_attribute("version")){
-                       int v = 
lexical_cast_default<int>(aiparam["version"],version);
+                       int v = aiparam["version"].to_int(version);
                        if (version<v) {
                                version = v;
                        }
@@ -295,7 +294,7 @@
        }
 
        LOG_AI_CONFIGURATION << "side "<< side <<": setting config version to 
"<< version << std::endl;
-       parsed_cfg["version"] = boost::lexical_cast<std::string>( version );
+       parsed_cfg["version"] = version;
 
 
        LOG_AI_CONFIGURATION << "side "<< side <<": merging AI aspect with 
the same id"<< std::endl;




Related Messages


Powered by MHonArc, Updated Sat Jun 12 21:00:13 2010