diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-17 16:34:36 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-17 16:34:36 +0300 |
commit | c6c4eef4e49bb4de90845408af9f642a1a4e224b (patch) | |
tree | 81d192e85b3c075cb2e52671bea4c3c0499dc3f2 /src/gui/setup_relations.cpp | |
parent | 093e392dd84c920d26bca17d48ac6611393d087c (diff) | |
download | manaverse-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.gz manaverse-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.bz2 manaverse-c6c4eef4e49bb4de90845408af9f642a1a4e224b.tar.xz manaverse-c6c4eef4e49bb4de90845408af9f642a1a4e224b.zip |
Improve size calculations.
Diffstat (limited to 'src/gui/setup_relations.cpp')
-rw-r--r-- | src/gui/setup_relations.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp index d40995ac2..20ef3b3d4 100644 --- a/src/gui/setup_relations.cpp +++ b/src/gui/setup_relations.cpp @@ -152,7 +152,7 @@ public: mPlayers = player_names; // set up widgets - for (unsigned int r = 0; r < player_names->size(); ++r) + for (unsigned int r = 0, sz = player_names->size(); r < sz; ++r) { std::string name = (*player_names)[r]; gcn::Widget *widget = new Label(name); @@ -316,9 +316,9 @@ void Setup_Relations::reset() // current selection. We could use an index into the table of config // options in player_relations instead of strategies to sidestep this. int selection = 0; - for (unsigned int i = 0; - i < player_relations.getPlayerIgnoreStrategies()->size(); - ++i) + for (size_t i = 0, sz = player_relations.getPlayerIgnoreStrategies() + ->size(); i < sz; ++ i) + { if ((*player_relations.getPlayerIgnoreStrategies())[i] == player_relations.getPlayerIgnoreStrategy()) { @@ -326,7 +326,7 @@ void Setup_Relations::reset() selection = i; break; } - + } mIgnoreActionChoicesBox->setSelected(selection); } |