From 8553ead478755937bbdb42b726dc410e99195ce0 Mon Sep 17 00:00:00 2001 From: Guillaume Melquiond Date: Tue, 1 Jun 2010 06:43:30 +0000 Subject: [PATCH] Avoided costly roundtrip through strings. --- src/play_controller.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/play_controller.cpp b/src/play_controller.cpp index 1d61bca3f3d..0aaa0066d31 100644 --- a/src/play_controller.cpp +++ b/src/play_controller.cpp @@ -90,7 +90,7 @@ play_controller::play_controller(const config& level, game_state& state_of_game, loading_game_(level["playing_team"].empty() == false), first_human_team_(-1), player_number_(1), - first_player_(lexical_cast_default(level_["playing_team"], 0) + 1), + first_player_(level_["playing_team"].to_int() + 1), start_turn_(turn()), is_host_(true), skip_replay_(skip_replay), @@ -150,9 +150,9 @@ void play_controller::init(CVideo& video){ } recorder.set_skip(false); - const bool snapshot = utils::string_bool(level_["snapshot"]); + bool snapshot = level_["snapshot"].to_bool(); - if(utils::string_bool(level_["modify_placing"])) { + if (level_["modify_placing"].to_bool()) { LOG_NG << "modifying placing...\n"; place_sides_in_preferred_locations(); }