config::merge_with now appends tag which are not found.
This commit is contained in:
parent
66a2560f09
commit
53b6b8c656
1 changed files with 2 additions and 4 deletions
|
@ -535,13 +535,10 @@ config config::merge_with(const config& c) const
|
|||
}
|
||||
const child_map& child_changes = c.all_children();
|
||||
child_map::const_iterator i;
|
||||
// std::map<std::string , size_t> index_map;
|
||||
for(i = child_changes.begin(); i != child_changes.end(); ++i) {
|
||||
// const size_t index = index_map[(*i).first]++;
|
||||
|
||||
size_t index = 0;
|
||||
for(const_child_iterator j = i->second.begin(); j != i->second.end(); ++j) {
|
||||
//const std::pair<const std::string*,const config*> item = *j;
|
||||
const config* item = *j;
|
||||
|
||||
if(i->first.empty()) {
|
||||
|
@ -549,9 +546,10 @@ config config::merge_with(const config& c) const
|
|||
}
|
||||
|
||||
const child_map::iterator itor = n.children.find(i->first);
|
||||
//const child_map::iterator itor = children.find(*item.first);
|
||||
if(itor != n.children.end() && index < itor->second.size()) {
|
||||
*(itor->second[index]) = itor->second[index]->merge_with(*item);
|
||||
} else {
|
||||
n.add_child(i->first,*item);
|
||||
}
|
||||
|
||||
index++;
|
||||
|
|
Loading…
Add table
Reference in a new issue