Return by const reference, not by const value.

As a result, 3bf175313b has been reverted.
This commit is contained in:
Andrius Silinskas 2014-02-05 21:22:09 +00:00
parent 3bf8e052f3
commit 43b134de9b
2 changed files with 2 additions and 5 deletions

View file

@ -59,7 +59,7 @@ public:
// matching the criteria.
int find_suitable_faction(const std::string& faction_id = "") const;
const std::vector<const config*> choosable_factions() const
const std::vector<const config*>& choosable_factions() const
{ return choosable_factions_; }
const std::vector<std::string>& choosable_leaders() const
{ return choosable_leaders_; }

View file

@ -290,10 +290,7 @@ void connect::side::add_widgets_to_scrollpane(gui::scrollpane& pane, int pos)
void connect::side::update_faction_combo()
{
std::vector<std::string> factions;
const std::vector<const config*>& choosable =
engine_->flg().choosable_factions();
BOOST_FOREACH(const config* faction, choosable) {
BOOST_FOREACH(const config* faction, engine_->flg().choosable_factions()) {
const std::string& name = (*faction)["name"];
const std::string& icon = (*faction)["image"];
if (!icon.empty()) {