mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
dependency: No point scanning for circularity on 'add'
This commit is contained in:
parent
774cf3e2d9
commit
0a0793b2ca
1 changed files with 27 additions and 21 deletions
|
@ -67,7 +67,12 @@ void dependencyGetBlocking (const Task& task, std::vector <Task>& blocking)
|
|||
// Returns true if the supplied task adds a cycle to the dependency chain.
|
||||
bool dependencyIsCircular (const Task& task)
|
||||
{
|
||||
std::string task_uuid = task.get ("uuid");
|
||||
|
||||
// A new task has no UUID assigned yet, and therefore cannot be part of any
|
||||
// dependency chain.
|
||||
if (task.has ("uuid"))
|
||||
{
|
||||
auto task_uuid = task.get ("uuid");
|
||||
|
||||
std::stack <Task> s;
|
||||
s.push (task);
|
||||
|
@ -98,6 +103,7 @@ bool dependencyIsCircular (const Task& task)
|
|||
|
||||
s.pop ();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue