Removed unnecessary unit_type_data::insert wrapper

Again, std::map::emplace can be used, though TBH insert could just as well have been used inline
so I have absolutely no idea why this function existed except to obfuscate things.
This commit is contained in:
Charles Dang 2017-05-06 22:19:36 +11:00
parent 79ca2aaff4
commit 8f610ec207
2 changed files with 1 additions and 2 deletions

View file

@ -1128,7 +1128,7 @@ void unit_type_data::set_config(config &cfg)
handle_variations(ut);
// Record this unit type.
if ( insert(std::make_pair(id, unit_type(ut))).second ) {
if(types_.emplace(id, unit_type(ut)).second) {
LOG_CONFIG << "added " << id << " to unit_type list (unit_type_data.unit_types)\n";
} else {
ERR_CF << "Multiple [unit_type]s with id=" << id << " encountered." << std::endl;

View file

@ -339,7 +339,6 @@ private:
/** Parses the [hide_help] tag. */
void read_hide_help(const config &cfg);
std::pair<unit_type_map::iterator, bool> insert(const std::pair<std::string, unit_type> &utype) { return types_.insert(utype); }
void clear();
void add_advancefrom(const config& unit_cfg) const;