dependency: No point scanning for circularity on 'add'
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user