Skip to content

Commit

Permalink
Convert uses of boost::flat_set to std::set
Browse files Browse the repository at this point in the history
The performance difference is irrelevant with the small number of elements.
  • Loading branch information
Vultraz committed Jul 29, 2016
1 parent 2a88d0d commit e8b4b44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/game_events/conditional_wml.cpp
Expand Up @@ -169,7 +169,7 @@ namespace { // Support functions
}

vconfig::all_children_iterator cond_end = cond.ordered_end();
static const boost::container::flat_set<std::string> hard_coded =
static const std::set<std::string> hard_coded =
{"true", "false", "have_unit", "have_location", "variable", "then", "else", "elseif", "not", "and", "or", "do"};

assert(resources::lua_kernel);
Expand Down
6 changes: 2 additions & 4 deletions src/play_controller.cpp
Expand Up @@ -87,9 +87,7 @@ static lg::log_domain log_engine_enemies("engine/enemies");
*/
static void copy_persistent(const config& src, config& dst)
{
typedef boost::container::flat_set<std::string> stringset;

static stringset attrs = {
static const std::set<std::string> attrs = {
"id",
"theme",
"next_scenario",
Expand All @@ -103,7 +101,7 @@ static void copy_persistent(const config& src, config& dst)
"experience_modifier",
"require_scenario"};

static stringset tags = {
static const std::set<std::string> tags = {
"terrain_graphics",
"lua"};

Expand Down
2 changes: 1 addition & 1 deletion src/team.cpp
Expand Up @@ -54,7 +54,7 @@ const int team::default_team_gold_ = 100;

// Update this list of attributes if you change what is used to define a side
// (excluding those attributes used to define the side's leader).
const boost::container::flat_set<std::string> team::attributes = {"ai_config",
const std::set<std::string> team::attributes = {"ai_config",
"carryover_add", "carryover_percentage", "color", "controller", "current_player", "defeat_condition", "flag",
"flag_icon", "fog", "fog_data", "gold", "hidden", "income",
"no_leader", "objectives", "objectives_changed", "persistent", "lost",
Expand Down
4 changes: 2 additions & 2 deletions src/team.hpp
Expand Up @@ -23,7 +23,7 @@
#include "util.hpp"
#include "config.hpp"

#include <boost/container/flat_set.hpp>
#include <set>

class game_data;
class gamemap;
Expand Down Expand Up @@ -168,7 +168,7 @@ class team

/// Stores the attributes recognized by [side]. These should be stripped
/// from a side's config before using it to create the side's leader.
static const boost::container::flat_set<std::string> attributes;
static const std::set<std::string> attributes;

void build(const config &cfg, const gamemap &map, int gold = default_team_gold_);

Expand Down

0 comments on commit e8b4b44

Please sign in to comment.