Parser
- ::findModifications moves branch pruning out of the iterated loop.
This commit is contained in:
@@ -1583,9 +1583,9 @@ void Parser::findFilter ()
|
|||||||
void Parser::findModifications ()
|
void Parser::findModifications ()
|
||||||
{
|
{
|
||||||
context.debug ("Parser::findModifications");
|
context.debug ("Parser::findModifications");
|
||||||
bool action = false;
|
|
||||||
bool after_writecmd = false;
|
bool after_writecmd = false;
|
||||||
|
|
||||||
|
std::vector <Tree*> prune;
|
||||||
std::vector <Tree*> nodes;
|
std::vector <Tree*> nodes;
|
||||||
collect (nodes, collectAll);
|
collect (nodes, collectAll);
|
||||||
std::vector <Tree*>::iterator i;
|
std::vector <Tree*>::iterator i;
|
||||||
@@ -1604,12 +1604,16 @@ void Parser::findModifications ()
|
|||||||
{
|
{
|
||||||
(*i)->unTag ("?");
|
(*i)->unTag ("?");
|
||||||
(*i)->tag ("MODIFICATION");
|
(*i)->tag ("MODIFICATION");
|
||||||
(*i)->removeAllBranches ();
|
// (*i)->removeAllBranches ();
|
||||||
action = true;
|
prune.push_back (*i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action)
|
// Prune branches outside the loop.
|
||||||
|
for (i = prune.begin (); i != prune.end (); ++i)
|
||||||
|
(*i)->removeAllBranches ();
|
||||||
|
|
||||||
|
if (prune.size ())
|
||||||
context.debug (_tree->dump ());
|
context.debug (_tree->dump ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user