Simplify config::merge_children_by_attribute
This commit is contained in:
parent
717aa892d2
commit
7db4527b0f
1 changed files with 1 additions and 7 deletions
|
@ -595,13 +595,7 @@ void config::merge_children_by_attribute(const std::string& key, const std::stri
|
|||
typedef std::map<std::string, config> config_map;
|
||||
config_map merged_children_map;
|
||||
for (const config &cfg : child_range(key)) {
|
||||
const std::string &value = cfg[attribute];
|
||||
config_map::iterator m = merged_children_map.find(value);
|
||||
if ( m!=merged_children_map.end() ) {
|
||||
m->second.append(cfg);
|
||||
} else {
|
||||
merged_children_map.insert(make_pair(value, cfg));
|
||||
}
|
||||
merged_children_map[cfg[attribute]].append(cfg);
|
||||
}
|
||||
|
||||
clear_children(key);
|
||||
|
|
Loading…
Add table
Reference in a new issue