Return by const reference, not by const value.
As a result, 3bf175313b
has been reverted.
This commit is contained in:
parent
3bf8e052f3
commit
43b134de9b
2 changed files with 2 additions and 5 deletions
|
@ -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_; }
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Reference in a new issue