mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Parser
- ::findModifications moves branch pruning out of the iterated loop.
This commit is contained in:
parent
d6ad010085
commit
4a07f4e546
1 changed files with 8 additions and 4 deletions
|
@ -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 ());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue