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:
parent
79ca2aaff4
commit
8f610ec207
2 changed files with 1 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue