mail[Wesnoth-commits] r43138 - /trunk/src/playturn.cpp


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

Header


Content

Posted by guillaume . melquiond on June 02, 2010 - 22:36:
Author: silene
Date: Wed Jun  2 22:36:07 2010
New Revision: 43138

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

Modified:
    trunk/src/playturn.cpp

Modified: trunk/src/playturn.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playturn.cpp?rev=43138&r1=43137&r2=43138&view=diff
==============================================================================
--- trunk/src/playturn.cpp (original)
+++ trunk/src/playturn.cpp Wed Jun  2 22:36:07 2010
@@ -85,9 +85,7 @@
 
        if (const config &msg = cfg.child("message"))
        {
-               const int side = lexical_cast_default<int>(msg["side"],0);
-
-               resources::screen->add_chat_message(time(NULL), 
msg["sender"], side,
+               resources::screen->add_chat_message(time(NULL), 
msg["sender"], msg["side"],
                                msg["message"], 
events::chat_handler::MESSAGE_PUBLIC,
                                preferences::message_bell());
        }
@@ -334,11 +332,7 @@
        config& change = cfg.add_child("change_controller");
        change["side"] = side;
        change["player"] = player;
-
-       if(own_side) {
-               change["own_side"] = "yes";
-       }
-
+       if (own_side) change["own_side"] = true;
        network::send_data(cfg, 0, true);
 }
 




Related Messages


Powered by MHonArc, Updated Thu Jun 03 00:20:07 2010