Skip to content

Commit

Permalink
Change a config to const config so operator[] does not add attributes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ja-MiT committed Feb 23, 2014
1 parent f10eaeb commit 7c17ae2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1257,12 +1257,13 @@ void config::merge_with(const config& c)
if (j != c.children.end()) {
unsigned &visits = visitations[tag];
if(visits < j->second.size()) {
// Get a const config so we do not add attributes.
const config & merge_child = *j->second[visits++];

if ((*j->second[visits])["__remove"].to_bool()) {
visits++;
if ( merge_child["__remove"].to_bool() ) {
to_remove.push_back(*i);
} else
(i->pos->second[i->index])->merge_with(*j->second[visits++]);
(i->pos->second[i->index])->merge_with(merge_child);
}
}
}
Expand Down

0 comments on commit 7c17ae2

Please sign in to comment.